Convert between date and unix timestamp: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
Line 87: Line 87:
<pre>
<pre>
= TEXT( (Unixtime / 86400) + 25569, "YYYY-mm-dd hh:mm:ss")
= TEXT( (Unixtime / 86400) + 25569, "YYYY-mm-dd hh:mm:ss")
</pre>
=== MySQL way: convert to date from unix timestamp ===
timezone: server timezone dependent {{exclaim}}
<pre>
SELECT FROM_UNIXTIME(IF(`timestamp_column` = 0, NULL, `timestamp_column`, "%Y-%m-%d %h:%i:%s")
</pre>
</pre>


Anonymous user

Navigation menu