Writing a valid, functional, and strict MySQL regular expression for latitudes and longitudes is much harder than I thought it would be. Note that I said “MySQL” because they have their own regex engine apparently.
New to the site? Create an account →
tcr!
· Aug 20, 2018 at 3:16 pm
Writing a valid, functional, and strict MySQL regular expression for latitudes and longitudes is much harder than I thought it would be. Note that I said “MySQL” because they have their own regex engine apparently.
tcr!
· Feb 14, 2013 at 1:21 pm
-1, cause this is about answering questions and not linking to places where one needs to create an account, download something and eventually find an answer or NOT. – user667073 Jan 30 at 13:38
I <3 answers and answer replies like this.
tcr!
· Aug 30, 2011 at 5:41 pm
The more I think about passwords and data types, the more I started thinking about changing the various data types for the various database fields. My mind thinks all the time, it’s homicidal.
I’m not a database programmer by any means, but I do regret storing date/times as TIMESTAMP
. I wish I would’ve used a simple INT
populated with Unix time. For one reason only – timezones.
As an example, 2011-08-30 19:20:20
tells me nothing about the timezone. Why is this important? Pretend there’s a worldwide, online discussion starting at 7:20 pm and you’re invited!
…
MySQL stores TIMESTAMP
fields based on a timezone setting that you can set and update via MySQL and PHP, etc. Yuck. Why the yuck? Because if I dump the database from a server in PST and import it to a server in CST, the times will be wrong. Yuck.
Maybe there’s a slick workaround for this that I don’t know. Honestly, I just want the time stamp to be reliable. Any programmer looking at 1314705293
will probably guess what it is and know how to work with it.
And since I can’t leave well enough alone, SELECT UNIX_TIMESTAMP(created_on) AS created_on_unix ... UPDATE created_on = created_on_unix
has become my new best friend.
Brandon Godwin
· Aug 30, 2011 at 10:51 pm
Since MySQL 5 I believe, the TIMESTAMP data type is converted to UTC when it's stored and converted back into the timezone of the server or connection set timezone when retrieved. Storing the date and time as a TIMESTAMP allows you to perform date operations in the query, such as adding or subtracting time from it for a WHERE clause.
However, make sure you use TIMESTAMP and not DATETIME for this. DATETIME does not handle the timezone conversion.
tcr!
· Sep 1, 2011 at 6:14 am
Thanks for the tip! I didn't know that.
Page 1 of 1
keamoose · Aug 20, 2018 at 3:29 pm
I hope you only have to do it once; look at all of the different versions they had to implement for GNWT!
tcr! · Aug 20, 2018 at 4:08 pm
What is this devil worship?
keamoose · Aug 20, 2018 at 4:10 pm
Government + committee + engineers = devil. Actually it works pretty well. https://www.maps.geomatics.gov.nt.ca/HTML5Viewer_Prod/index.html?viewer=ATLAS
tcr! · Aug 20, 2018 at 5:40 pm
Ah nice! I see that you can search for parcels.
keamoose · Aug 20, 2018 at 6:43 pm
You can search for more or less anything if you have the right permissions on your login. Like, the property assessment guys can search by the names of homeowners. I can’t imagine what the database must look like. I mostly use it for air photos and land tenure (e.g. to see if an area is owned by the territorial government or by the municipality). It has some nice features; I always feel appreciative of the programmers when I use it. 😊
Reply
Post