Can anyone explain why strtotime('cast') returns a value?

筅森魡賤 提交于 2019-12-31 01:48:08

问题


Not really an issue (although it is conflicting with an if() statement we have), but when you type in strtotime('cast'), it returns an actual value that defaults to today's date.

I was just wondering if anyone knew what significance the word cast has when it comes to time functions

Thanks!


回答1:


It maps to the timezone offset for "Australia/Adelaide".

Example:

echo date('Y-m-d H:i:s'), "\n",
     date('Y-m-d H:i:s', strtotime("cast")), "\n",
     date('Y-m-d H:i:s', strtotime("Australia/Adelaide"));

Prints:

2016-08-25 10:48:44
2016-08-25 01:18:44
2016-08-25 01:18:44


来源:https://stackoverflow.com/questions/39142012/can-anyone-explain-why-strtotimecast-returns-a-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!