Thanks a ton Igor!
It worked. Your help is greatly appreciated.
Thanks,
JP



________________________________
From: Igor Tandetnik <itandet...@mvps.org>
To: sqlite-users@sqlite.org
Sent: Thursday, April 16, 2009 4:52:28 AM
Subject: Re: [sqlite] Need help with the SQL statement.

"Joanne Pham" <joannekp...@yahoo.com>
wrote in message news:348376.69121...@web90302.mail.mud.yahoo.com
> 20657220 is number of minutes in GMT time zone.
> So we need to convert to second by 20657220 *60.
> select datetime(20657220*60, 'unixepoch','localtime' );
> will be 2009-04-11 00:00:00

In this case, this should work:

strftime('%s', date(startTime*60, 'unixepoch', 'localtime'), 'utc')/60

You convert your UTC timestamp to localtime, strip time portion (by way 
of date() function), then convert the result back to UTC (by way of 
strfrime(..., 'utc'). This way you'll get a UTC timestamp that 
corresponds to midnight local time of the same calendar date.

Igor Tandetnik 



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



      
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to