Thanks Karthick. My code too works fine... (I made a small typo mistake in query, which executed silently) But I guess your method is the right one.
Regards, Lloyd On Wed, 2006-12-20 at 16:54 +0530, Karthick V - TLS , Chennai wrote: > Let the time zone given by user > +0530 > > Therefore its 330 minutes / 13200 seconds > > select datetime( StartTime,'unixepoch','+13200.0 seconds') from mytable > --- gives you the local time > > Select datetime( StartTime,'unixepoch')----gives u universal time > > Where StartTime is an integer(unixtimestamp stored in the database) > > > With Regards > > Karthick V > > > "Don't bother just to be better than your contemporaries or predecessors. > Try to be better than yourself" > William Faulkner > > -----Original Message----- > From: Lloyd [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 20, 2006 10:30 AM > To: sqlite-users@sqlite.org > Subject: [sqlite] Time zone conversion > > Hi, > I would like to implement a time zone independent function. So I get the > time zone information from user, and plans to convert the datetime to the > time zone specified. To make it clear I give an example > > here StartTime is stored as an integer in the database > > select datetime(StartTime,'unixepoch') from mytable; > > will give the universal time. > > To get the local time, what I do is- Let the time zone given by user > +0530 > > convert +0530 to seconds, =13200 ((5*60+30)*60), then > > select datetime(StartTime+13200,'unixepoch') from mytable; > > But it is not working as I expected. (no result is shown) > > what could be the reason? Is there any better way for me to achieve the same > result? > > Thanks and Regards, > Lloyd > > > ______________________________________ > Scanned and protected by Email scanner > > ---------------------------------------------------------------------------- > - > To unsubscribe, send email to [EMAIL PROTECTED] > ---------------------------------------------------------------------------- > - > DISCLAIMER > The contents of this e-mail and any attachment(s) are confidential and > intended for the > > named recipient(s) only. It shall not attach any liability on the originator > or HCL or its > > affiliates. Any views or opinions presented in this email are solely those of > the author and > > may not necessarily reflect the opinions of HCL or its affiliates. Any form > of reproduction, > > dissemination, copying, disclosure, modification, distribution and / or > publication of this > > message without the prior written consent of the author of this e-mail is > strictly > > prohibited. If you have received this email in error please delete it and > notify the sender > > immediately. Before opening any mail and attachments please check them for > viruses and > > defect. > > ----------------------------------------------------------------------------- > To unsubscribe, send email to [EMAIL PROTECTED] > ----------------------------------------------------------------------------- > ______________________________________ Scanned and protected by Email scanner ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------