Skip to content

Instantly share code, notes, and snippets.

@noppolp
Created May 13, 2015 16:48
Show Gist options
  • Select an option

  • Save noppolp/c755ea62f33b5b070574 to your computer and use it in GitHub Desktop.

Select an option

Save noppolp/c755ea62f33b5b070574 to your computer and use it in GitHub Desktop.
Convert DateTime.Ticks into PHP time() and convert back
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