date() 和 strftime() 在 Windows 和 Linux 上不一样。为什么?
为什么 Windows 不支持 date()
和 strftime()
的某些选项?我认为与日期相关的任何东西都是每个系统都应该支持的。是因为日期内部存储的方式吗?
Why are some options to date()
and strftime()
not supported on Windows? I though anything related to date is something that every system should support. Is it because of the way the date is internally stored?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
date() 手册指出了两个区别:
对于 strftime():
你是这个意思吗?好吧,原因已经解释过了,不支持负时间戳。我认为对此无能为力。
如果这给您带来问题,您可能需要使用 Zend_Date< 之类的库/a>.
The manual on date() points out two differences:
and for strftime():
is that what you mean? Well, the reasons are explained there already, no support for negative timestamps. I don't think much can be done about that.
If that is giving you problems, you may want to go with a library like Zend_Date.
这是因为
date
和strftime
只是底层系统函数的薄包装,因此它们只接受操作系统支持的函数。http://linux.die.net/man/3/strftime
http://msdn.microsoft.com/en-我们/库/fe06s4ak%28VS.71%29.aspx
It's because
date
andstrftime
are just thin wrappers around underlying system functions, so that they accept only those functions that the operating system supports.http://linux.die.net/man/3/strftime
http://msdn.microsoft.com/en-us/library/fe06s4ak%28VS.71%29.aspx