2 Replies Latest reply on Jan 5, 2016 12:47 PM by WolfShade

    What is the week number given by function "week" ?

    pierredupli Level 1

      Just using function "week" which gives 2 as week number for monday January 4th which is wrong.


      According to ISO standard, week number one is the week containing January 4th.




        • 1. Re: What is the week number given by function "week" ?
          BKBK Adobe Community Professional & MVP

          Yes, ColdFusion's week numbering system is different from the ISO date standard. For example, in ColdFusion the week begins on Sunday. Whereas in the ISO standard it begins on Monday.


          There is nothing wrong with that. The ISO standard is a convention, and is not mandatory

          • 2. Re: What is the week number given by function "week" ?
            WolfShade Level 4

            Seeing as 01 JAN and 02 JAN are Friday and Saturday, respectively, wouldn't that be week 1, regardless of ISO standard?  04 JAN is the first Monday, yes, but (by the calendar) is the second week.






            UPDATE: Ah, I see.. the ISO standard is counting the first week of the year as the first week that has a Thursday in it.. and uses Monday as the start of the week.  That may be ISO standard, but since different cultures see the start/end of the week in different ways, this cannot be relied upon.  And, as BKBK mentions, isn't really mandatory, anyway.