Created
May 14, 2014 14:26
-
-
Save yang-wei/4f841ada8c0ab4743602 to your computer and use it in GitHub Desktop.
Get the FTW Unix TimeStamp of any format of time easily
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// use DateTime object to turn any format of date & time into standard form | |
//Example1 | |
$date = DateTime::createFromFormat('m/d/y @ h:ia', '04/04/2014 @ 3.13pm')->getTimestamp(); | |
//Example2 | |
$date = DateTime::createFromFormat('YmdHis', '20130312000000')->getTimestamp(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment