Re: selecting timestamp
| От | chris |
|---|---|
| Тема | Re: selecting timestamp |
| Дата | |
| Msg-id | 030374b6-2793-4b7a-970f-929f2050b277@pgsqlrocket.com обсуждение исходный текст |
| Ответ на | Re: selecting timestamp ("David G. Johnston" <david.g.johnston@gmail.com>) |
| Список | pgsql-general |
Thank you everyone for the help.
Sorry there wasn't much detail given originally.
CURRENT_TIMESTAMP at time zone 'UTC' as ct4Seems to be working well.
Thanks,
Chris
On 02/27/2018 01:26 PM, David G. Johnston wrote:
What is the best way of selecting current timestamp in UTC?You haven'tdefinedcriteria upon which to judge - and the list below is not exhaustive (but sufficiently so)SELECTCURRENT_TIMESTAMP as ct1standard conforming, assumes server configured for UTC,timezone('UTC',CURRENT_TIMESTAMP) as ct2 ,timezone('utc',now()) as ct3non-standard, personally non-obvious (the function looks like an implementation detail that should be avoided),CURRENT_TIMESTAMP at time zone 'UTC' as ct4This -standard conforming and doesn't require assumptions about the calling environment,NOW() at time zone 'utc' as ct5non-standard but frequently used; no semantic different compared to the previous entryDavid J.
В списке pgsql-general по дате отправления: