clock_iso8601(3tcl)
π NAME π
clock_iso8601 β literally just parsing ISO 8601 dates/times, bestie π
This one's a Tcllib Date/Time Utilities page, so pull up a chair, grab a boba, and let's get into it β¨
πΈ SYNOPSIS πΈ
package require Tcl 8.5 9
package require clock::iso8601 ?0.2?
::clock::iso8601 parse_date date options...
::clock::iso8601 parse_time time options...
π DESCRIPTION π
So this package is the girl who parses dates and times in ISO 8601 format. That's the whole job. She's iconic, she's focused, she ate π
::clock::iso8601 parse_date date options...β this command takes an ISO8601 date string in an unknown variant and hands you back the given date/time in seconds since epoch. No cap. The options it'll accept are-base,-gmt,-locale, and-timezoneβ yep, those are the ones from the builtin commandclock scanπ«Ά::clock::iso8601 parse_time time options...β this command parses a full ISO8601 timestamp string (that's date and time, she's doing both π) in an unknown variant, and returns the given time in seconds since epoch. Same deal for options:-base,-gmt,-locale, and-timezone, all of them straight from the builtinclock scanβ¨
π¦ DATE FORMATS π¦
Okay so here's the tea: these commands accept the following 23 date formats. Twenty-three. She said "I contain multitudes" π
(year)-(month)-(day)
(year)(month)(day)
(year)-(day in year)
(year)(day in year)
(year in century)-(month)-(day)
(year)-(month)Day defaults to the 1st of the month
(year in century)(month)(day)
(year in century)-(day in year)
(year in century)(day in year)
--(month)-(day)Year defaults to the current year
--(month)(day)Year defaults to the current year
--(day in year)Year defaults to the current year
---(day) Year defaults to the current year, month to current month
(fiscal year)-W(week)-(wday)
(fiscal year)W(week)-(wday)
(fiscal year in century)-W(week)-(wday)
(fiscal year in century)W(week)(wday)
(fiscal year)-W(week)Weekday defaults to monday
(fiscal year)W(week)Weekday defaults to monday
-W(week)-(wday)Year defaults to current fiscal year
-W(week)(wday)Year defaults to current fiscal year
(wday) Year defaults to current fiscal year, week to current week
(year) Month defaults to january, day to 1st of the month
π The parts and what they mean π
These are the possible parts/fields up in all those formats, and their meanings, so you're never out here guessing π§
yearβ Year with century, 4 digitsmonthβ Month in year, 2 digitsdayβ Day in month, 2 digits.year in centuryβ Year without century, 2 digitsday in yearβ Day in year, 3 digitsfiscal yearβ ISO 8601 fiscal year with century, 4 digitsfiscal year in centuryβ ISO 8601 fiscal year without century, 2 digitsweekβ ISO 8601 week numberwdayβ Week day, 1 digit, Monday (1) to Sunday (7,0)
π BUGS, IDEAS, FEEDBACK π
Not me having to say this, but: this document, and the package it describes, will undoubtedly contain bugs and other problems. It's giving "we're all just doing our best" π
Please report such in the category clock::iso8601 of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist. And please also report any ideas for enhancements you may have for either the package and/or the documentation β she wants to hear them, fr fr π
When proposing code changes, please provide unified diffs, i.e. the output of diff -u.
Also note β and this is important, bestie β attachments are strongly preferred over inlined patches. You can make an attachment by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. Slay.
π CATEGORY π
Text processing πΈ
tcllib, version 0.2, clock_iso8601(3tcl) β that's the whole page, bestie. Go parse something iconic, you've got this π
β¨π«Ά
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms