Convert between date and unix timestamp: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
Line 27: Line 27:


{{exclaim}} [https://support.office.com/zh-tw/article/value-%E5%87%BD%E6%95%B8-257d0108-07dc-437d-ae1c-bc2d3953d8c2 VALUE()] function on Excel is  number of days since 1900/1/1. [https://support.google.com/docs/answer/3094220?hl=en VALUE()] function on Google sheet is number of days since 1899/12/30 {{access | date=2019-05-22}}
{{exclaim}} [https://support.office.com/zh-tw/article/value-%E5%87%BD%E6%95%B8-257d0108-07dc-437d-ae1c-bc2d3953d8c2 VALUE()] function on Excel is  number of days since 1900/1/1. [https://support.google.com/docs/answer/3094220?hl=en VALUE()] function on Google sheet is number of days since 1899/12/30 {{access | date=2019-05-22}}
== Convert between date and unix timestamp ==
Online tool
* {{Gd}} [https://www.unixtimestamp.com/index.php Unix Time Stamp - Epoch Converter]


<pre>
<pre>
Line 37: Line 42:
// 2019-03-14T00:00:00+00:00 in RFC 3339
// 2019-03-14T00:00:00+00:00 in RFC 3339
</pre>
</pre>
== Convert between date and unix timestamp ==
Online tool
* {{Gd}} [https://www.unixtimestamp.com/index.php Unix Time Stamp - Epoch Converter]


=== PHP way: convert to date time from unix timestamp ===
=== PHP way: convert to date time from unix timestamp ===
Using the [https://www.php.net/manual/en/function.date.php date()] function
<pre>
<pre>
date_default_timezone_set("Europe/London");
date_default_timezone_set("Europe/London");
Line 56: Line 56:




=== PHP way: convert to unix timestamp from date time ===
=== PHP way: convert to unix timestamp from date time ===
Using the [https://www.php.net/manual/en/function.strtotime.php strtotime()] function
<pre>
<pre>
date_default_timezone_set("Europe/London");
date_default_timezone_set("Europe/London");

Navigation menu