clock_iso8601(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– 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