Unix timestamp before 1970 (even before 1700), usi

2019-01-24 08:57发布

问题:

how can i work with dates before 01.01.1970?

i need to get first day of the month for dates from year 1700.

how can i achieve that?

thank you in advance!

回答1:

You can use DateTime.

Example:

<?php
$d = new DateTime("1780-06-01");
echo $d->format("l"); //Thursday

You should, however, consider that the Gregorian Calendar was adopted in different instants throughout the world.



回答2:

Try using the Zend Date classes, or the older PEAR Date class



标签: php timestamp