php 将日期转换为 UNIX 时间戳
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11324195/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Convert Date to UNIX timestamp
提问by user1425322
I'm having a date format of Jun 26, '12.strtotime()converts proper date string, and this string results in a blank output.
This can be solved but I can only think of ugly ways of doing it.
我的日期格式为Jun 26, '12. strtotime()转换正确的日期字符串,此字符串导致空白输出。这可以解决,但我只能想到丑陋的方法。
Any ideas for converting this date format to UNIX timestamp elegantly?
有什么想法可以优雅地将此日期格式转换为 UNIX 时间戳?
回答by user850234
How about this strtotime('Jun 26,12');
这个怎么样 strtotime('Jun 26,12');
回答by vikramaditya234
回答by Charlie Martin
Um, s/'/20/g'? Followed by strtotime()?
嗯,s/'/20/g'?其次是strtotime()?

