Created
October 27, 2020 13:41
-
-
Save moradi-morteza/476b22bcad71ada805ba70fc4fedcb8a to your computer and use it in GitHub Desktop.
[date and Time]
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
// date to timestamp | |
function dateToTimeStamp($date = '2020-10-01 17:38:15',$format ='Y-m-d H:i:s'){ | |
$d = DateTime::createFromFormat($format,$date); | |
return $d->getTimestamp(); | |
} | |
function timeStampToDate($timestamp=1601573895,$format ='Y-m-d H:i:s'){ | |
return date($format, $timestamp); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment