Editing Convert date time from t z format

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
Convert date time from T Z format (ISO 8601 format<ref>[https://en.wikipedia.org/wiki/ISO_8601 ISO 8601 - Wikipedia]</ref>; Zulu time format<ref>[https://greenwichmeantime.com/articles/history/zulu/ Zulu Time | GMT]</ref>) e.g. {{kbd |key=2020-05-08T10:01:45Z}} or {{kbd |key=2020-05-06T22:48:51.660Z}}
+
Convert date time from T Z format (ISO 8601 format, Z(ulu) time) e.g. {{kbd |key=2020-05-08T10:01:45Z}} or {{kbd |key=2020-05-06T22:48:51.660Z}}
  
 
== PHP approach ==
 
== PHP approach ==
Line 8: Line 8:
 
</pre>
 
</pre>
  
{{exclaim}} The returned result is server timezone dependent if you set the timezone using [https://www.php.net/manual/en/function.date-default-timezone-set.php date_default_timezone_set].
+
{{exclaim}} The returned result is server timezone dependent if you specify the timezone
 
<pre>
 
<pre>
 
date_default_timezone_set("Asia/Taipei");
 
date_default_timezone_set("Asia/Taipei");
Line 36: Line 36:
  
 
== References ==
 
== References ==
<references />
+
* [https://en.wikipedia.org/wiki/ISO_8601 ISO 8601 - Wikipedia]
 
 
 
 
 
* [https://stackoverflow.com/questions/15902464/format-of-2013-04-09t100000z-in-php Format of 2013-04-09T10:00:00Z in php - Stack Overflow]
 
* [https://stackoverflow.com/questions/15902464/format-of-2013-04-09t100000z-in-php Format of 2013-04-09T10:00:00Z in php - Stack Overflow]
* [https://stackoverflow.com/questions/44802061/convert-string-to-datetime-in-my-sql mysql - convert string to datetime in my sql - Stack Overflow]
 
 
* [https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_str-to-date STR_TO_DATE(str,format)]
 
* [https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_str-to-date STR_TO_DATE(str,format)]
 
* [https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format DATE_FORMAT(date,format)]
 
* [https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format DATE_FORMAT(date,format)]

Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see LemonWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Templates used on this page: