Date format "variables"

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Garonne
Posts: 195
Joined: 21 Apr 2015 19:10
Location: Win11, 100% Scaling
Contact:

Date format "variables"

Post by Garonne »

Do we have a full documentation of the date format variables available?
I checked the documentation and only found the information available in the "date variable" section, which isn't at all complete.

Of course I was able to deduce some based on the information given:
  • d -- Day of Month, no leading zero
  • dd -- Day of Month, leading zero
  • ddd -- Day of Week, Abbreviated
  • dddd -- Day of Week, Full
  • ddddd -- Full date (System Format, short?)
  • dddddd -- Full date (System Format, long?)
  • m -- Month, no leading zero
  • mm -- Month, leading zero
  • mmm -- Month, Abbreviated
  • mmmm -- Month, Full
  • yy -- Year, two digits
  • yyyy -- Year, four digits
  • w -- Day of Week (numeric, Sun-Sat, 1-7?)
  • ww -- ISO number of Week?
  • h/hh -- Hour of day (24h format?) without/with zero padding
  • n/nn -- Minute (without/with zero padding)
  • s/ss -- Second (without/with zero padding)
  • Zodiac -- Date converted to Zodiac sign text
  • ISOWeek -- ISO Week Format (Year-"W"Week-DayOfWeek)
Anything else?

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Date format "variables"

Post by bdeshi »

  • f[ffffff] -- microseconds
  • c -- date and time
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 66347
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Date format "variables"

Post by admin »

echo <datem hh:nn am/pm>;
echo <datem hh:nn AM/PM>;

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Date format "variables"

Post by TheQwerty »

  • c
    • System's short date and time format.
      This is equivalent to: ddddd ttttt
  • ttttt
    • Time in System's long time format.
  • q
    • Quarter of the year as a number (1-4).
  • ww
    • Week of the year.
      This uses Sunday as the first day of the week (or maybe it's locale specific?) unlike ISOWeek which uses Monday as the first day of the week.
  • y
    • Day of the year.
Format preceding time according to 12-hour clock and use the specified markers:
  • AM/PM
  • am/pm
  • A/P
  • a/p
  • AMPM
    • Uses the System/locale marker for AM and PM.
Predefined formats, as defined by the System/locale and application's current culture:
  • General Date
  • Long Date
  • Medium Date
  • Short Date
  • Long Time
  • Medium Time
  • Short Time
Additionally:
  • In a <date...> variable List will use the date column's format.
  • The m and mm patterns are "smart," if either is preceded by an hour format specifier then they become minute, instead of month.

    Code: Select all

    echo <date m mm h:m hh:mm>;

admin
Site Admin
Posts: 66347
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Date format "variables"

Post by admin »

Thanks, I learned something here.

Garonne
Posts: 195
Joined: 21 Apr 2015 19:10
Location: Win11, 100% Scaling
Contact:

Re: Date format "variables"

Post by Garonne »

Awesome. Thanks.

Don, you might want to add that to the help file sometime...

EDIT: Damn... Had to revert to use /i in renaming anyways because EXIF doesn't store fractions of seconds, so <dateexif yyyy-mm-dd hh-nn-ss> isn't unique when taking photo-series (i.e. multiple shots per second) and (as noted) <dateexif yyyy-mm-dd hh-nn-ss.fff> doesn't work as fractions aren't saved.

Post Reply