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

Day Of Week...Microsoft vs. TCC

Discussion in 'T&T - Scripting' started by Joe Caverly, Jul 7, 2017.

  1. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    697
    Likes Received:
    8
    It would appear that TCC and Microsoft differ on how they return the day of the week as an integer.

    TCC has Sunday=1, while Microsoft has Sunday=0

    Thus, as today is Friday, TCC has Friday=6, while Microsoft has Friday=5

    I discovered this while using the wmic command.
    Code:
    wmic path win32_localtime
    Day  DayOfWeek  Hour  Milliseconds  Minute  Month  Quarter  Second  WeekInMonth  Year
    7    5          8                   1       7      3        54      2            2017
    Thus;
    Code:
    echo %@execstr[1,wmic path win32_localtime get DayOfWeek]
    returns the Microsoft Day Of The Week.

    Here is the link to the Win32_LocalTime Documentation.

    According to ISO 8601, Monday is the first day of the week. It is followed by Tuesday, Wednesday, Thursday, Friday, and Saturday. Sunday is the 7th and final day.

    Although this is the international standard, several countries, including the United States, Canada, and Australia consider Sunday as the start of the week.

    This is not a bug, just something that I discovered, and am passing along.

    Joe
     
    #1 Joe Caverly, Jul 7, 2017
    Last edited: Jul 7, 2017
  2. Rodolfo

    Joined:
    May 20, 2009
    Messages:
    216
    Likes Received:
    0
    Using the example that I find in the manual for ISODOWI, I get a strange result.
    Code:
    [C:\Program Files\JPSoft\TCMD21]echo %_date
    07/07/17
    
    [C:\Program Files\JPSoft\TCMD21]echo %@isodowi[%_date]
    2
    
    [C:\Program Files\JPSoft\TCMD21]
    
    Regards

    Rodolfo Giovanninetti
     
  3. Rodolfo

    Joined:
    May 20, 2009
    Messages:
    216
    Likes Received:
    0
    Wrong issue, %_date returns the date maybe not in a iso format.


    Regards

    Rodolfo Giovanninetti
     
  4. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    697
    Likes Received:
    8
    Code:
    echo %@isodowi[%_isodate]
    5
    
    Joe
     
  5. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    697
    Likes Received:
    8
    Yes, _isodowi returns 5.

    Joe
     

Share This Page