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

Functions @year[date] @isowyear[date] help

Discussion in 'Support' started by rps, Jan 16, 2014.

  1. rps

    rps

    Joined:
    Jul 6, 2008
    Messages:
    231
    Likes Received:
    3
    Here is what I get when I use the functions @year[] & @isowyear[]

    I am using TCMD V16, windows 7 ultimate sp1.

    There are no Plugins loaded.

    Copied and pasted from the TC help v.16.0

    Code:
    Thu  Jan 16, 2014  3:07:27 [6840]
    C:\JPSoft\plugins>echo %@isowyear[%_date]
    TCC: Invalid date "%@isowyear[01/16/14]"
    
    Thu  Jan 16, 2014 10:31:03 [6840]
    C:\JPSoft\plugins>echo %@year[5-5-2012,1]
    TCC: (Sys) Incorrect function.
     "%@year[5-5-2012,1]"
    
    
    Other attempts :

    Code:
    Thu  Jan 16, 2014  2:59:48 [6840]
    C:\JPSoft\plugins>*echo %@YEAR[%_DATE]
    TCC: (Sys) Incorrect function.
     "%@YEAR[01/16/14]"
    
    Thu  Jan 16, 2014  2:59:52 [6840]
    C:\JPSoft\plugins>echo %@year[5-5-2012]
    TCC: (Sys) Incorrect function.
     "%@year[5-5-2012]"
    
    
    The following seem to work so the help for @ISOWYEAR[date] just needs updating. Not tested but I suspect that the @ISODOWI[date] and @ISOWEEK[date] examples need updating.

    Code:
    Thu  Jan 16, 2014 10:31:28 [6840]
    C:\JPSoft\plugins>echo %@isowyear[%_isodate]
    2014
    
    Thu  Jan 16, 2014 10:36:10 [6840]
    C:\JPSoft\plugins>echo %_isodate
    2014-01-16
    
    Thu  Jan 16, 2014 10:36:13 [6840]
    C:\JPSoft\plugins>echo %@isowyear[2014-01-22]
    2014
    
    The remaining questions is; What am I missing when trying to use the @year function?

    rps
     
  2. Peniel02

    Joined:
    Dec 30, 2010
    Messages:
    12
    Likes Received:
    0
  3. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    Under Regional Settings, what is your date setting format? Mine is yyyy-mm-dd and it reports errors for 5-5-2012 and 5/5/12.
     
  4. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
  5. djspits

    Joined:
    Apr 13, 2010
    Messages:
    189
    Likes Received:
    2
    Since v16 the following code stopped working.

    Code:
    echo %@year[%_date]
    (Yes, I know there is a better way to get that year. That's not the point, is it?)
     
  6. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    Confirmed. Charles Dye's iso8601.dll masks the problem.
     
  7. Peniel02

    Joined:
    Dec 30, 2010
    Messages:
    12
    Likes Received:
    0
    Steve,

    Excellent suggestion, I didn't know that was there. I must have been doing this the "hard way" since way back in the 90's. Hummph, I need to RTFM more often! (*grin)

    That %_datetime is what I ultimately have been creating (less the last 2 'seconds' numbers) with a couple of aliases for a long time!

    -Peniel02
     
  8. Peniel02

    Joined:
    Dec 30, 2010
    Messages:
    12
    Likes Received:
    0
    [​IMG]

    M/d/yyyy
     

Share This Page