timezone difference in timestamp?
От | meltedown |
---|---|
Тема | timezone difference in timestamp? |
Дата | |
Msg-id | vyI3h.183348$bL1.31394@fe04.news.easynews.com обсуждение исходный текст |
Ответы |
Re: timezone difference in timestamp?
Re: timezone difference in timestamp? |
Список | pgsql-general |
Short version: I'm trying to turn a unix timestamp into a psql timestamp, but there is a 5 hour difference. Is this because of timezones ? Can I just subtract 5 hours to get the right value ? Detailed version: I start with a unix timestamp: $startofday =1162789200; Which has this date: Array ( [seconds] => 0 [minutes] => 0 [hours] => 0 [mday] => 6 [wday] => 1 [mon] => 11 [year] => 2006 [yday] => 309 [weekday] => Monday [month] => November [0] => 1162789200 ) Then I make a pgsql timestamp like this: "select timestamp '1970-01-01' + interval '$startofday seconds' as timestamp" And the result is: timestamp 2006-11-06 05:00:00 timestamp It seems like it should be 2006-11-06 00:00:00 This seems to work but can I always get the correct value by subtracting 5 hours like this? "select timestamp '1970-01-01' + interval '$startofday seconds'-interval '5 hours' as timestamp"
В списке pgsql-general по дате отправления: