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 systemstrftimeroutines, 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 (range01to31).%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 (range00to23).%Iβ The hour as a decimal number using a 12-hour clock (range01to12).%jβ The day of the year as a decimal number (range001to366).%kβ The hour (24-hour clock) as a decimal number (range0to23); single digits are preceded by a blank. (See also%H.)%lβ The hour (12-hour clock) as a decimal number (range1to12); single digits are preceded by a blank. (See also%I.)%mβ The month as a decimal number (range01to12).%Mβ The minute as a decimal number (range00to59).%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%Tbelow.%sβ The number of seconds since the Epoch,1970-01-01 00:00:00 +0000(UTC).%Sβ The second as a decimal number (range00to60). (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, range1to7, Monday being1. See also%w.%Uβ The week number of the current year as a decimal number, range00to53, starting with the first Sunday as the first day of week01. See also%Vand%W.%vβ Equivalent to%e-%b-%Y.%Vβ The ISO 8601 week number of the current year as a decimal number, range01to53, where week 1 is the first week that has at least 4 days in the new year. See also%Uand%W.%wβ The day of the week as a decimal, range0to6, Sunday being0. See also%u.%Wβ The week number of the current year as a decimal number, range00to53, starting with the first Monday as the first day of week01.%xβ Equivalent to%a %b %d %Y.%Xβ Equivalent to%T.%yβ The year as a decimal number without a century (range00to99).%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 Unixdatecommand 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%3would 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 π
- PLplot documentation at
http://plplot.sourceforge.net/documentation.php.
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
- ubuntu stonking: plplot-doc 5.15.0+dfsg3-4 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms