Your machine has the timezone recorded and localtime uses that to make the appropriate correction from UTC (Greenwich or Zulu) time.

This approach makes the time correct if you are operating across time zones. It is the way your Unixepoch time expects to work. A machine which gives the correct time in New York gives incorrect time in Seattle unless you use UCT and apply the New York and Seattle time zones.

If you use a Unix machine you will see an environment variable TZ with a value like TZ=EET-10EETDT-11,J298,J90 which encodes the time zone, the offset from UCT, the daylight savings zone and offset and the julian days of the switch in and out of summer time.

When a user logs in their profile can override the default time zone.

Windows does a similar thing when you set up the OS and define the time zone by selecting it on a map.

Lloyd wrote:
Hi,

I felt sqlite's date and time functions are very useful and suits my
needs.

But still am not clear about one thing. I gave the following query

select datetime(1162961284,'unixepoch');

2006-11-08 04:48:04

The date is correct but the time is 5 hours lagging. So for local time
correction I gave the following query

 select datetime(1162961284,'unixepoch','localtime');

 2006-11-08 10:18:04

The result is correct.

I would like to know how sqlite is performing the localtime correction.
My problem is, I am getting these time stamps from network packets, And
I want to  display it accurately. (as in the localtime).

Which way can I prefer ?

Thanks,
  Lloyd.



______________________________________
Scanned and protected by Email scanner

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to