一年的周 [英] Week of the Year

查看:161
本文介绍了一年的周的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据ISO 8601,第一周是至少4天的周,周从星期一开始。

As per ISO 8601, the first week is the week having at least 4 days and week start with Monday. For countries where the week starts with another day, like Sunday, how is the first week defined ?

推荐答案

周可以定义为各种各样的方式。

Weeks can be defined in all sorts of ways.

ISO 8601 标准(从星期一开始,星期#1具有第一个星期四)是明智和实用的,并且越来越常见。在Java及其 java.time 框架(请参见教程),标准定义的行为封装在< a href =https://docs.oracle.com/javase/8/docs/api/java/time/temporal/IsoFields.html =nofollow> IsoFields 类。有关示例,请参阅我的答复到另一个问题。

The ISO 8601 standard way (starts on Monday, week # 1 has first Thursday of year) is sensible and practical, and increasingly common. In Java and its java.time framework (see Tutorial), the standard defined behavior is encapsulated in the IsoFields class. See my Answer to another Question for examples.

强>非标准方法差异很大。在与项目的利益相关者确定这样的定义时要非常清楚。

The non-standard approaches vary widely. Be very clear in determining such definitions with the stakeholders in your project. Document the definitions in your code base as well.

公司通常使用自己定义的财政年度用于其他业务目的,而一些公司仅将会计年度用于记账和另一个日历系统进行操作。该会计年度通常由其最后一天是某一天的某一天来定义,例如最接近12月31日的星期五。

Often a company uses their own defined fiscal year for other business purposes, while some companies use the fiscal year only for bookkeeping and another calendar system for operations. Often the fiscal year is defined by its last day being a certain day-of-week such as the Friday closest to 31 December. So a year may have 52 or 53 weeks.

有时候第1周是包含1月1日的星期。有些人包括前一天那一周(12月31日,12月30日等)在新的一年的一周,而有些人把这一周分为两部分(去年的部分和新年的部分)。

Sometimes week number 1 is the week containing January 1. Some people include the prior days of that week (December 31, December 30, etc.) in that new year’s week while some people cut the week into two parts (last year’s part and new year’s part).

有人将第#1周定义为包含一周中第一天的最早一周。当然,一周的第一天是由文化规范定义的,如美国的星期日。

Some define week # 1 as the earliest week that contains the first day of the week. Of course that first day of the week is defined by cultural norms such as Sunday in the United States.

有些人将周数1定义为一年中的第一个完整周,没有前几年的天数。因此,1月1日,1月2日等等可能会计入去年。

Some people define week number 1 as the first complete week of the year, having no days from the previous years. So January 1, January 2, and so on may be counted in the last year.

一些行业和一些公司定义了自己的一周。一些是可以预测的,可以确定地投射到未来,而一些是任意的,并由人类每年或两三个定义。

Some industries and some companies define their own weeks of the year. Some are predictable with a pattern that can deterministically be projected out into the future, while some are arbitrary and defined by humans every year or two or three.

直到20世纪90年代, Eastman Kodak公司几十年来一直使用和推广了一种完全不同的日历系统,国际固定日历。该系统提供一年的13个月,每个28天(正好4周),每个日期固定在同一个工作日。因此,每年的第1周从1月1日开始。

Until the 1990s, the Eastman Kodak Company for decades used and promoted a very different calendar system, the International Fixed Calendar. This system provides for a year of 13 months of 28 days each (exactly 4 weeks), with every date fixed always on the same weekday. So every year has week # 1 starting on Sunday January 1.

法国共和日历是另一个不同的日历,使用十多年,每周十天。

The French Republican Calendar is another different calendar in use for over a decade, with a ten-day week.

保持心灵开放,了解日期时间事项如此。理解一天是由自然界(地球的旋转)定义的,一年是由自然界(地球绕太阳轨道),几个星期和几个月定义的,这是人类的发明。该定义受人类创造力和人类愚蠢(例如:夏令时废话)。

Keep your mind open, to make sense of date-time matters such as this. Understand that while a day is defined by nature (spinning of the earth) and a year is defined by nature (Earth’s orbit around the Sun), weeks and months and such are inventions of humans. The definition is subject to human creativity and to human folly (ex: Daylight Saving Time nonsense).

这篇关于一年的周的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆