dshun123456 2015-12-31 09:43
浏览 41
已采纳

是否存在多年定义周的数字周数格式?

With PHP date functions, we can easily use a week number which change 0 to 53. This count starts from zero each year.

I'm looking for a date format which give me a numeric value which is continuing each year without count reset.

Example:

this_week = 578 (this week is in 2015)
newt_week must be = 579 (even it's in next year)

Is there any pre-defined format for that purpose? If not, which approach can help me to find a custom solution?

  • 写回答

1条回答 默认 最新

  • dongmin4052 2015-12-31 09:54
    关注

    I would suggest using the PHP time function to convert to UNIX time (seconds since 1970-01-01). You can find the number of weeks since a given date by dividing by number of seconds in a week. In fact, the PHP documentation documentation (http://php.net/manual/en/function.time.php) shows an example very much like what you are trying to achieve.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 汇编语言除法溢出问题
  • ¥65 C++实现删除N个数据列表共有的元素
  • ¥15 Visual Studio问题
  • ¥15 state显示变量是字符串形式,但是仍然红色,无法引用,并显示类型不匹配
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗