Get the 0-value timestamp date with Carbon

前端 未结 1 984
旧时难觅i
旧时难觅i 2021-01-19 17:16

I am attempting to get the 0-value timestamp in an PHP API. I am currently using Carbon in a Laravel / Dingo API based system.

Is there a simple way to get the 0-val

1条回答
  •  粉色の甜心
    2021-01-19 18:04

    You could try:

    echo Carbon::createFromTimestamp(0)->toDateString();
    // Displays: 1970-01-01
    

    So you do not have to hardcode the date, just use a 0 timestamp.

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