Skip to content

Instantly share code, notes, and snippets.

@mtttmpl
Created January 8, 2014 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtttmpl/8316021 to your computer and use it in GitHub Desktop.
Save mtttmpl/8316021 to your computer and use it in GitHub Desktop.
1900 Date System converter to PHP takes $date as unix time and returns days since 1900.
<?php
function get_1900_date($date) {
$start = strtotime("1900-01-01");
$diff = $date - $start;
$days = $diff / 86400;
return round($days, 0);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment