5.7 Format Strings

20220526 The date format strings will replace the %X special characters with specific components from the date (and time). For example, based on the result of a call to the function lubridate::now(), which is Friday, 3 March 2023, 20:36:20 PM, the format is %A, %e %B %Y, %H:%M:%S %p.

The format strings that are available include:

  • %a \(\longrightarrow\) Fri (3 char day name)
  • %A \(\longrightarrow\) Friday (full day name)
  • %b \(\longrightarrow\) Mar (3 char month name)
  • %B \(\longrightarrow\) March (full month name)
  • %d \(\longrightarrow\) 03 (leading 0 numeric day of month)
  • %e \(\longrightarrow\) 3 (numeric day of month)
  • %H \(\longrightarrow\) 20 (numeric hours)
  • %m \(\longrightarrow\) 03 (numeric month)
  • %M \(\longrightarrow\) 36 (numeric minutes)
  • %p \(\longrightarrow\) PM (lower morning or afternoon)
  • %P \(\longrightarrow\) pm (upper morning or afternoon)
  • %S \(\longrightarrow\) 20 (numeric seconds)
  • %Y \(\longrightarrow\) 2023 (4 digit year)
  • %Z \(\longrightarrow\) AEDT (time zone)

Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0