Created
May 13, 2015 16:48
-
-
Save noppolp/c755ea62f33b5b070574 to your computer and use it in GitHub Desktop.
Convert DateTime.Ticks into PHP time() and convert back
This file contains hidden or 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
| public static function TicksToTime($tick){ | |
| return floor(($ticks - 621355968000000000) / 10000000); | |
| } | |
| public static function TimeToTicks($time){ | |
| return number_format(($time * 10000000) + 621355968000000000 , 0, ’.’, “); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment