PLTIMEFMT(3plplot)

✨ PLTIMEFMT πŸ’…

okay so real talk, bestie β€” we're in the PLplot API today, and this page is literally all about one tiny little function that controls how your date/time labels look. It's called pltimefmt and it's giving "small but powerful" main character energy. πŸŽ€


🌸 NAME 🌸

pltimefmt β€” set format for date / time labels. That's it, that's the whole vibe. πŸ¦‹


⭐ SYNOPSIS ⭐

pltimefmt(fmt)

πŸ’– DESCRIPTION πŸ’–

So pltimefmt sets the format for date / time labels. Obsessed already. ✨

But heads up β€” setting the format here doesn't magically make date/time labels appear. To actually enable date / time format labels, you gotta check out the options in plbox(3plplot), plbox3(3plplot), and plenv(3plplot). That's where the enabling happens, iykyk. πŸ’…

Also, the Redacted form (yes, that's a real thing they call it) is:

pltimefmt(fmt)

And this function is used in example 29. Slay. 🧚


πŸŽ€ ARGUMENTS πŸŽ€

  • fmt (PLCHAR_VECTOR(3plplot), input) β€” an ascii character string, okay? And here's the tea: it gets interpreted similarly to the format specifier of typical system strftime routines, except PLplot ignores locale and also supplies some useful extensions in the context of plotting. 🫢

So everything in the string prints as-is, except for conversion specifications β€” those take the form of a % character followed by further conversion specification character. Let's break down every single one because I would never leave you hanging. 😭

🌈 The ones similar to system strftime routines 🌈

  • %a β€” The abbreviated (English) weekday name.
  • %A β€” The full (English) weekday name.
  • %b β€” The abbreviated (English) month name.
  • %B β€” The full (English) month name.
  • %c β€” Equivalent to %a %b %d %T %Y (non-ISO).
  • %C β€” The century number (year/100) as a 2-digit integer.
  • %d β€” The day of the month as a decimal number (range 01 to 31).
  • %D β€” Equivalent to %m/%d/%y (non-ISO).
  • %e β€” Like %d, but a leading zero is replaced by a space.
  • %F β€” Equivalent to %Y-%m-%d (the ISO 8601 date format).
  • %h β€” Equivalent to %b.
  • %H β€” The hour as a decimal number using a 24-hour clock (range 00 to 23).
  • %I β€” The hour as a decimal number using a 12-hour clock (range 01 to 12).
  • %j β€” The day of the year as a decimal number (range 001 to 366).
  • %k β€” The hour (24-hour clock) as a decimal number (range 0 to 23); single digits are preceded by a blank. (See also %H.)
  • %l β€” The hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank. (See also %I.)
  • %m β€” The month as a decimal number (range 01 to 12).
  • %M β€” The minute as a decimal number (range 00 to 59).
  • %n β€” A newline character.
  • %p β€” Either "AM" or "PM" according to the given time value. Noon is treated as "PM" and midnight as "AM".
  • %r β€” Equivalent to %I:%M:%S %p.
  • %R β€” The time in 24-hour notation (%H:%M). For a version including the seconds, see %T below.
  • %s β€” The number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
  • %S β€” The second as a decimal number (range 00 to 60). (The range is up to 60 to allow for occasional leap seconds.)
  • %t β€” A tab character.
  • %T β€” The time in 24-hour notation (%H:%M:%S).
  • %u β€” The day of the week as a decimal, range 1 to 7, Monday being 1. See also %w.
  • %U β€” The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01. See also %V and %W.
  • %v β€” Equivalent to %e-%b-%Y.
  • %V β€” The ISO 8601 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the new year. See also %U and %W.
  • %w β€” The day of the week as a decimal, range 0 to 6, Sunday being 0. See also %u.
  • %W β€” The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01.
  • %x β€” Equivalent to %a %b %d %Y.
  • %X β€” Equivalent to %T.
  • %y β€” The year as a decimal number without a century (range 00 to 99).
  • %Y β€” The year as a decimal number including a century.
  • %z β€” The UTC time-zone string = "+0000".
  • %Z β€” The UTC time-zone abbreviation = "UTC".
  • %+ β€” The UTC date and time in default format of the Unix date command which is equivalent to %a %b %d %T %Z %Y.
  • %% β€” A literal "%" character.

πŸ¦‹ The extensions (aka the bonus content) πŸ¦‹

  • %(0-9) β€” The fractional part of the seconds field (including leading decimal point) to the specified accuracy. Thus %S%3 would give seconds to millisecond accuracy (00.000).
  • %. β€” The fractional part of the seconds field (including leading decimal point) to the maximum available accuracy. Thus %S%. would give seconds with fractional part up to 9 decimal places if available.
ngl those last two are the ones that make plots look expensive. The way that %S%. just casually gives you up to 9 decimal places if available. Iconic. πŸ”₯

πŸ‘‘ AUTHORS πŸ‘‘

Many developers (who are credited at http://plplot.sourceforge.net/credits.php) have contributed to PLplot over its long history. Respect the elders, fr fr. πŸ™ˆ


πŸ“ SEE ALSO πŸ“


and that's the whole page, bestie πŸ’œ this was PLTIMEFMT(3plplot) from the PLplot API β€” source/version vibes from August, 2026, delivered with love and absolutely zero cap. Go format some timestamps and ate. πŸŒŸπŸ’…πŸ«Ά

πŸ“¦ where this page comes from