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 Wednesday, 7 September 2022, 17:18:39 PM, the format is %A, %e %B %Y, %H:%M:%S %p.

The format strings that are available include:

  • %a \(\longrightarrow\) Wed (3 char day name)
  • %A \(\longrightarrow\) Wednesday (full day name)
  • %b \(\longrightarrow\) Sep (3 char month name)
  • %B \(\longrightarrow\) September (full month name)
  • %d \(\longrightarrow\) 07 (leading 0 numeric day of month)
  • %e \(\longrightarrow\) 7 (numeric day of month)
  • %H \(\longrightarrow\) 17 (numeric hours)
  • %m \(\longrightarrow\) 09 (numeric month)
  • %M \(\longrightarrow\) 18 (numeric minutes)
  • %p \(\longrightarrow\) PM (lower morning or afternoon)
  • %P \(\longrightarrow\) pm (upper morning or afternoon)
  • %S \(\longrightarrow\) 39 (numeric seconds)
  • %Y \(\longrightarrow\) 2022 (4 digit year)
  • %Z \(\longrightarrow\) AEST (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