Showing posts with label datetime. Show all posts
Showing posts with label datetime. Show all posts

Monday, June 11, 2012

Formatting a date in JavaScript


I noticed that JavaScript's new Date() function is very smart in accepting dates in several formats.

Sunday, May 27, 2012

How do you get a timestamp in JavaScript?


How can I get a timestamp in JavaScript?



Something similar to Unix's timestamp, that is, a single number that represents the current time and date. Either as a number or a string.

Friday, May 25, 2012

Thursday, May 24, 2012

datetime vs timestamp?


What would you recommend using between a datetime and a timestamp field, and why? (using mysql). I'm working with php on the server side.

Wednesday, May 23, 2012

Calculating relative time


Given a specific DateTime value, how do I display relative time, like

MySQL datetime fields and daylight savings time — how do I reference the "extra' hour?


I'm using the America/New York timezone. In the Fall we "fall back" an hour -- effectively "gaining" one hour at 2am. At the transition point the following happens:

Thursday, May 17, 2012

Monday, April 23, 2012

How to check is timezone identifier valid from code?


I'll try to explain what's the problem here.



According to list of supported timezones from PHP manual, I can see all valid TZ identifiers in PHP.

Sunday, February 12, 2012

How do I determine if a string is date format?


I have some strings like this: 2012-02-05T07:42:47.000Z mixed with other strings. It is always in this format. (but the numbers are not the same, of course...the times are different) (not Sun, 05 Feb 2012 07:42:47 GMT )