Last active
January 3, 2026 01:55
-
-
Save arkiuat/7e169d8a106a919f50a21f8435604dda to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| my constant @lsmonth := < | |
| 1972-06 1972-12 1973-12 1974-12 1975-12 1976-12 1977-12 1978-12 1979-12 | |
| 1981-06 1982-06 1983-06 1985-06 1987-12 1989-12 1990-12 1992-06 1993-06 | |
| 1994-06 1995-12 1997-06 1998-12 2005-12 2008-12 2012-06 2015-06 2016-12 | |
| >; | |
| sub leap-sec( Int(Str) $year, Int(Str) $month --> DateTime ) { | |
| DateTime.new( | |
| date => Date.new($year, $month, 1).last-date-in-month, | |
| :23hour, | |
| :59minute, | |
| :60second | |
| ) | |
| } | |
| my constant @leapsec := @lsmonth.comb(/ \d+ /).map: &leap-sec; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment