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

date range documentation error

Discussion in 'Support' started by Roedy, Feb 24, 2010.

  1. Roedy

    Joined:
    Jun 8, 2008
    Messages:
    120
    Likes Received:
    2
    In the help for TCC date ranges it suggests:

    To select files last modified n days ago or earlier, use /[d-n,1/1/80]. For example, to get a directory of all files last modified 3 days or more before today (i.e., those files not modified within the last 3 days), you could use this command:

    dir /[d-3,1/1/80]

    This does not work. I needed to use:

    dir /[d-3,1980/1/1]

    Logically you should specify that as:
    dir /[1980/1/1,d-3]
    or even better:
    dir /[,d-3]
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    date range documenation error

    | In the help for TCC date ranges it suggests:
    |
    | To select files last modified n days ago or earlier, use
    | /[d-n,1/1/80]. For example, to get a directory of all files last
    | modified 3 days or more before today (i.e., those files not modified
    | within the last 3 days), you could use this command:
    |
    | dir /[d-3,1/1/80]
    |
    | This does not work. I needed to use:
    |
    | dir /[d-3,1980/1/1]

    All examples use the US as the default country format. If in Windows'
    Regional Settings you selected a different format (mine is modified ISO,
    i.e., I use period . as both date and time separator), that's the format
    expected.


    | Logically you should specify that as:
    | dir /[1980/1/1,d-3]
    | or even better:
    | dir /[,d-3]

    1/ The "[d" is the syntax for date range, it does not indicate anything
    about whether or not the current date is relevant in the selection.
    2/ It is explicitly stated that the order of dates is not significant,
    i.e., the earlier date can be either the first parameter or the second
    parameter, but if the first parameter is a relative date, it is relative to
    today, while the second parameter, if it is a relative date and not an
    absolute one is relative to the first date.
    3/ There is the simplified "negated range" method: /![d-2] to list all
    entries which are more than 2 days old (i.e., at least 3 days old).
    --
    HTH, Steve
     
  3. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    If you use ISO8601 format, the range will work regardless of your locale settings:

    Code:
    dir /[d-3,1980-01-01]
    
    It's not well documented, but you can in fact do:

    Code:
    dir /![d-3]
    
    (Rex, both dateranges.htm and timeranges.htm allude to the possibility, but neither one includes an example. Without an example, it's not clear where the bang should go....)
     

Share This Page