Archive for March, 2010

Getting datetime type into JavaScript as Date object

March 25th, 2010 No comments

This is not any new thing and may be discussed at different other places. But just as I came across like any other things, I just wanted to make a record of this.

When selecting datetime to be displayed in a JavaScript ui library, select the unix_timestamp * 1000 from the sql.
Read more…

Categories: Javascript, mysql, PHP, Tips Tags: ,

Session TimeZones and DateTime fields

March 10th, 2010 No comments

Today I was pondering over how to coax mysql (and mssql) to automagically select local time if a session variable was set with the required timezone. Well we arrived at a conclusion that we could not do that on DateTime fields in MySQL. Alas we were having varchar(19) in the equivalent field in MsSQL, which was the outcome of an import from MySQL using a connection string and a procedure. We were at a dismay, and admitted defeat. Later while having lunch, I got enlightend about using the built in functions to do the methodical conversions.
Read more…

Categories: General Articles, mysql Tags: ,