clock_iso8601(3tcl)

πŸ“¦
version 2.0 Β· 3 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸŽ€ 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 command clock 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 builtin clock 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 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)

😭 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