PHP » GoLang |
login |
register |
about
|
GoLang DateTime::createFromFormat
request it (628)
GoLang replacement for PHP's DateTime::createFromFormat
[edit | history]
PHP DateTime::createFromFormatPHP original manual for DateTime::createFromFormat [ show | php.net ]DateTime::createFromFormatdate_create_from_format(PHP 5 >= 5.3.0, PHP 7) DateTime::createFromFormat -- date_create_from_format — Parses a time string according to a specified format DescriptionObject oriented style
public static DateTime DateTime::createFromFormat
( string
$format
, string $time
[, DateTimeZone $timezone
] )Procedural style
Returns a new DateTime object representing the date and time specified by the
Parameters
Return Values
Returns a new DateTime instance or Changelog
ExamplesExample #1 DateTime::createFromFormat() example Object oriented style
<?php Procedural style
<?php The above examples will output: 2009-02-15 Example #2 Intricacies of DateTime::createFromFormat()
<?php The above example will output something similar to: Current time: 2010-04-23 10:29:35 Format: Y-m-d; 2009-02-15 10:29:35 Format: Y-m-d H:i:s; 2009-02-15 15:16:17 Format: Y-m-!d H:i:s; 1970-01-15 15:16:17 Format: !d; 1970-01-15 00:00:00 Example #3 Format string with literal characters
<?php The above example will output something similar to: 23:15:03 See Also
|
more
Recently updated
more
Most requested
more
Last requests
|