1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? Can anybody explain what @isowyear does please?

Discussion in 'Support' started by Dan Glynhampton, Mar 29, 2013.

  1. Dan Glynhampton

    Joined:
    Feb 26, 2013
    Messages:
    100
    Likes Received:
    0
    The help for @isowyear says

    Returns the ISO8601 numeric week date year.

    which I must confess I don't understand. I thought I'd try it out and try to understand it from its output, but I can't work out what's going on here (note that my date format is set to DD/MM/YY):

    d:\>ver /r

    TCC 15.00.23 x64 Windows 7 [Version 6.1.7601]
    TCC Build 23 Windows 7 Build 7601 Service Pack 1

    d:\>echo %@isowyear[01/02/03]
    2001

    d:\>echo %@isowyear[01/02/06]
    2001

    d:\>echo %@isowyear[12/12/01]
    2012

    d:\>echo %@isowyear[11/11/24]
    2011

    d:\>echo %@isowyear[12/01/01]
    2011


    Can anyone clarify what the function does?

    Thanks

    Dan
     
  2. Stein Oiestad

    Joined:
    Sep 11, 2012
    Messages:
    56
    Likes Received:
    1
    See http://en.wikipedia.org/wiki/ISO_8601#Week_dates

    If you look at the other ISO date related and the try the following, I guess it will make sense:


    echo %@isowyear[2014-01-01]
    echo %@isowyear[2013-12-31]
    echo %@isowyear[2013-12-30]
    echo %@isowyear[2013-12-29]
    It seems to be expecting a date formatted as YYYY-MM-DD.
     
  3. Dan Glynhampton

    Joined:
    Feb 26, 2013
    Messages:
    100
    Likes Received:
    0
    Ah, OK. So if a date early in January of <YEAR> is in ISO week 52/53 of <YEAR - 1> it returns <YEAR -1>.

    Think I get it, thanks.

    Dan
     
  4. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    And vice versa; as many as three days at the end of December may fall in the first week of the following year.
     

Share This Page