Tag Info

New answers tagged

0

TIMESTAMP stores the number of seconds from 1970-01-01 00:00:01 to now. It automatically converts to the date and time format when you retrieve the data. CURRENT_TIMESTAMP(): Returns the current date time with your timezone configured. UTC_TIMESTAMP(): Returns the current date and time using UTC timezone. If you're using a timezone that's not UTC, these ...


0

If you use current_timestamp, MySQL will use timezone which is configured in my.cnf. If no value is set in my.cnf, then MySQL will determine your operating systems' timezone and use that upon startup. You can see how your server is configured with this query: mysql> SELECT @@global.time_zone, @@session.time_zone; Also, it is possible to set timestamp ...


3

Here's a couple of approaches: I've simplified your query, as you shouldn't need the TRUNC(), nor the CAST(). SELECT to_timestamp(1395036000) AT TIME ZONE 'UTC'; SELECT timestamp '1970-01-01 00:00:00' + interval '1395036000 second'; For reference, more information is found at the below links: First query: ...



Top 50 recent answers are included