clock_iso8601(n)
π clock_iso8601(n) π
okay bestie, gather round, because this is the Date/Time Utilities corner of the Tcllib world and we are about to parse ISO 8601 dates like it's nothing. no cap.
β¨ NAME β¨
clock_iso8601 β parsing ISO 8601 dates/times, and honestly? it ate.
π 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...
like, that's it. that's the whole vibe. π
π¦ DESCRIPTION π¦
so this package gives you the whole functionality to parse dates and times in ISO 8601 format. two commands, both little icons, both carrying the team fr fr.
::clock::iso8601 parse_date date options...β this one takes an ISO8601 date string in an unknown variant and hands you back the given date/time in seconds since epoch. iconic behavior honestly.
the acceptable options are -base, -gmt, -locale, and -timezone β yes, the ones from the builtin command clock scan. those four, no others, don't try it.
::clock::iso8601 parse_time time options...β this one takes a full ISO8601 timestamp string (date and time, the whole thing) in an unknown variant and gives you the given time in seconds since epoch. main character energy.
same deal for options: -base, -gmt, -locale, and -timezone of the builtin command clock scan.
πΈ DATE FORMATS πΈ
bestie listen. these commands accept 23 date formats. twenty-three. she's flexible, she's versatile, she's booked and busy. here they all are, exactly as they come:
(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
and the possible parts/fields in all of that, plus what they actually mean:
yearβ year with century, 4 digits.monthβ month in year, 2 digits.dayβ day in month, 2 digits.year in centuryβ year without century, 2 digits.day in yearβ day in year, 3 digits.fiscal yearβ ISO 8601 fiscal year with century, 4 digits.fiscal year in centuryβ ISO 8601 fiscal year without century, 2 digits.weekβ ISO 8601 week number.wdayβ week day, 1 digit, Monday (1) to Sunday (7,0). yes both 7 and 0 count as Sunday, she contains multitudes.
π BUGS, IDEAS, FEEDBACK π
okay so real talk, no vibes-only here: this document, and the package it describes, will undoubtedly contain bugs and other problems. that's just the truth of it. please report such in the category clock::iso8601 of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist. and if you've got ideas for enhancements for either the package and/or the documentation, send those too, we want them fr fr.
when you're proposing code changes, please provide unified diffs, i.e the output of diff -u. not vibes. diffs.
also note: attachments are strongly preferred over inlined patches. you can attach stuff by going to the Edit form of the ticket right after you create it, then using the left-most button in the secondary navigation bar. that's the one. π«Ά
β CATEGORY β
Text processing.
and that's the whole page, bestie π this one's from tcllib, version 0.2, and it lives under clock_iso8601(n). periodt. β¨ππ¦
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms