Unix timestamp before 1970 (even before 1700), using PHP

后端 未结 2 1694
我在风中等你
我在风中等你 2020-12-18 00:35

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 adva

相关标签:
2条回答
  • 2020-12-18 01:06

    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.

    0 讨论(0)
  • 2020-12-18 01:10

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

    0 讨论(0)
提交回复
热议问题