免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3506 | 回复: 4
打印 上一主题 下一主题

问个timelocal [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-09-04 15:14 |只看该作者 |倒序浏览
我在用timelocal 计算时间的时候发现 月份那个变量 提示我只能是1-30 但8月应该是有31的 另外我发现计算间隔时 正好少那31号的时间 怎么解决这个问题?

论坛徽章:
0
2 [报告]
发表于 2009-09-04 15:16 |只看该作者
也就是 8月30号 00:00:00  到 9月1号 00:00:00 应该是 2*24*3600 但现在只是24*3600  怎么解决这个问题?

论坛徽章:
0
3 [报告]
发表于 2009-09-04 15:40 |只看该作者
没人答??  看来用Time::Local  还是解决不了 这个时间间隔的问题
找到一个别人解答的 http://www.cpanforum.com/threads/2881
留个给人参考

论坛徽章:
0
4 [报告]
发表于 2009-09-04 15:46 |只看该作者
也可以用shell下的date 失策!

论坛徽章:
0
5 [报告]
发表于 2009-09-04 18:18 |只看该作者
perldoc Time::Local
...
It is worth drawing particular attention to the expected ranges for the values provided. The value for the day of the month is the actual day   (ie 1..31), while the month is the number of months since January (0..11).  This is consistent with the values returned from localtime() and gmtime().

是不是LZ把月份输错了?8月份对应7,9月份对应8,自然没有31号

[ 本帖最后由 iceberg77 于 2009-9-4 18:19 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP