date
a moment in time
1# date: a moment, made with date() or now2date("2026-12-25 18:30")2026-12-25 18:30:00 -06:003# the current moment4now2026-11-04 12:12:41 -06:00Example outputCtrl+Enter to run
syntax
Section titled “syntax”1# + or - a duration moves it2now + 2 days2026-11-06 12:12:41 -06:003# to a time zone4now to "Tokyo"2026-11-05 03:12:41 +09:00Example outputCtrl+Enter to run
Functions that take it
Section titled “Functions that take it”yearthe year of a datemonththe month of a date, from 1 for January to 12daythe day of the month, from 1 to 31hourthe hour of a date, from 0 to 23minutethe minute of a date, from 0 to 59secondthe second of a date, from 0 to 59weekdaythe name of the day of the week, like “Friday”formata date as text laid out by strftime codes, such as %Y for the year, %m the month, %d the day, %H:%M the time and %B the month’s namewiththe same date with some parts changed, given as a map of year, month, day, hour, minute and second, like {day: 1}is_weekendwhether the date is a Saturday or Sundayis_weekdaywhether the date is Monday to Fridayis_todaywhether the date falls on today’s dateis_pastwhether the date is earlier than nowis_futurewhether the date is later than nowagehow many whole years have passed since d, as for someone’s age from their birthdaydiffthe time from a to b in calendar termsrelativehow far the date is from now, in words like “in 3 days” or “2 hours ago”unixthe Unix timestamp: seconds since the start of 1970 in UTC, the same asd to unixunix_msthe Unix timestamp in milliseconds, the same asd to unix_msweekday_numthe day of the week as a number, from 1 for Monday to 7 for Sundayday_of_yearwhich day of the year it is, from 1 to 366iso_weekthe week number by the ISO standard used in Europe and businessweek_numthe week number when weeks start on first_day, where week 1 is the week with January 1year_fracthe length of time from a to b as a number of years, by a day-count basisquarterwhich quarter of the year the date is in, 1 to 4leap_yearwhether the year is a leap yeardays_in_monthhow many days the date’s month hasdays_in_yearhow many days the date’s year has, 365 or 366start_ofthe first moment of the period the date is inend_ofthe last moment of the period the date is in, with periods as for start_ofnextthe first date after d that falls on the given weekday, never d itselfprevthe latest date before d that falls on the given weekday, never d itselfnth_weekdaythe nth given weekday in d’s month, like the 4th Thursdayadd_workdaysthe date n business days later, counting only Monday to Friday and skipping holidaysworkdayshow many business days (Monday to Friday, less holidays) there are from a up to, but not including, bcalendara month drawn as a calendar grid, weeks starting on Mondayzodiacthe Western star sign for a birthday (today without one)chinese_zodiacthe Chinese zodiac element and animal for a yearhebrewthe date in the Hebrew calendar, with months counted from Nisan, so Tishrei is 7islamicthe date in the Islamic (Hijri) calendar, by the arithmetic rulespersianthe date in the Persian (Solar Hijri) calendar used in Iran and Afghanistanjulianthe date in the Julian calendar, which Orthodox churches still use and which runs 13 days behindcopticthe date in the Coptic calendar of Egyptethiopianthe date in the Ethiopian calendarindianthe date in the Indian national (Saka) calendarjdthe Julian day number: days since noon UTC on 1 January 4713 BC (Julian), with the time of day as a fractionmjdthe modified Julian day number, which is the Julian day minus 2400000.5, so days start at midnightcalendars_ofthe date in every calendar zil knowsutcthe same moment in UTC, the zone with no offset that times are often stored inlocalthe same moment in your computer’s time zone, the same asd to localmoon_phasethe moon’s phase on a day (today without one), like “full moon”, and how much of it is lit
Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.