rfc:datetime_tostring

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
rfc:datetime_tostring [2012/09/01 10:05]
willfitch created
rfc:datetime_tostring [2017/09/22 13:28] (current)
Line 3: Line 3:
   * Date: 2012-09-01   * Date: 2012-09-01
   * Author: Will Fitch <​willfitch@php.net>​   * Author: Will Fitch <​willfitch@php.net>​
-  * Status: ​Under Discussion+  * Status: ​Inactive
  
 ===== Introduction ===== ===== Introduction =====
Line 53: Line 53:
 </​code>​ </​code>​
  
 +**Debug Output**
 +<code php>
 +<?php
 +$date = new DateTime('​2012-09-01 02:​43:​00'​);​
 +print_r($date);​
 +
 +$date->​setDefaultPattern('​Y-m-d'​);​
 +print_r($date);​
 +?>
 +</​code>​
 +
 +This will output the following:
 +<​code>​
 +DateTime Object
 +(
 +    [date] => 2012-09-01 02:43:00
 +    [timezone_type] => 3
 +    [timezone] => America/​Chicago
 +)
 +DateTime Object
 +(
 +    [date] => 2012-09-01 02:43:00
 +    [timezone_type] => 3
 +    [timezone] => America/​Chicago
 +    [default_pattern] => Y-m-d
 +)
 +</​code>​
 +
 +As you can see, the default pattern is managed via a class property called "​default_pattern"​.
 ===== Patch ===== ===== Patch =====
  
rfc/datetime_tostring.1346493903.txt.gz · Last modified: 2017/09/22 13:28 (external edit)