Submodules
Constants
APRIL

int

Represents the month of April as an index (1-indexed), this being 4.

AUGUST

int

Represents the month of August as an index (1-indexed), this being 8.

DECEMBER

int

Represents the month of December as an index (1-indexed), this being 12.

FEBRUARY

int

Represents the month of February as an index (1-indexed), this being 2.

JANUARY

int

Represents the month of January as an index (1-indexed), this being 1.

JULY

int

Represents the month of July as an index (1-indexed), this being 7.

JUNE

int

Represents the month of June as an index (1-indexed), this being 6.

MARCH

int

Represents the month of March as an index (1-indexed), this being 3.

MAY

int

Represents the month of May as an index (1-indexed), this being 5.

NOVEMBER

int

Represents the month of November as an index (1-indexed), this being 11.

OCTOBER

int

Represents the month of October as an index (1-indexed), this being 10.

SEPTEMBER

int

Represents the month of September as an index (1-indexed), this being 9.

Procedures
add_days

Returns the number of milliseconds that will have passed d days after the moment in time that is timestamp milliseconds after the 1st of January 1 AD at 00:00, not accounting for leap years or the different lenghts of months.

Arguments

timestamp - int

d - int

Returns

int

add_hours

Returns the number of milliseconds that will have passed h hours after the moment in time that is timestamp milliseconds after the 1st of January 1 AD at 00:00, not accounting for leap years or the different lenghts of months.

Arguments

timestamp - int

h - int

Returns

int

add_minutes

Returns the number of milliseconds that will have passed m minutes after the moment in time that is timestamp milliseconds after the 1st of January 1 AD at 00:00, not accounting for leap years or the different lenghts of months.

Arguments

timestamp - int

m - int

Returns

int

add_months

Returns the number of milliseconds that will have passed m months after the moment in time that is timestamp milliseconds after the 1st of January 1 AD at 00:00, accounting for leap years and the different lenghts of months.

Arguments

timestamp - int

m - int

Returns

int

add_seconds

Returns the number of milliseconds that will have passed s seconds after the moment in time that is timestamp milliseconds after the 1st of January 1 AD at 00:00, not accounting for leap years or the different lenghts of months.

Arguments

timestamp - int

s - int

Returns

int

add_weeks

Returns the number of milliseconds that will have passed w weeks after the moment in time that is timestamp milliseconds after the 1st of January 1 AD at 00:00, not accounting for leap years or the different lenghts of months.

Arguments

timestamp - int

w - int

Returns

int

add_years

Returns the number of milliseconds that will have passed y years after the moment in time that is timestamp milliseconds after the 1st of January 1 AD at 00:00, accounting for leap years.

Arguments

timestamp - int

y - int

Returns

int

as_day_of_month

Returns the number of full days passed since the start of the current month at the moment that is timestamp milliseconds after the 1st of January, 1 AD at 00:00. If timestamp was the number of milliseconds that passed since the 1st of January, 1 AD at 00:00 on the 3rd of February, 1973 at 23:05:13, that would result in 2 being returned.

Arguments

timestamp - int

Returns

int

as_day_of_week

Returns the number of full days passed since the start of the current week at the moment that is timestamp milliseconds after the 1st of January, 1 AD at 00:00. If timestamp was the number of milliseconds that passed since the 1st of January, 1 AD at 00:00 on the 3rd of February, 1973 at 23:05:13, that would result in 5 being returned.

Arguments

timestamp - int

Returns

int

as_day_of_year

Returns the number of full days passed since the start of the current year at the moment that is timestamp milliseconds after the 1st of January, 1 AD at 00:00. If timestamp was the number of milliseconds that passed since the 1st of January, 1 AD at 00:00 on the 3rd of February, 1973 at 23:05:13, that would result in 33 being returned.

Arguments

timestamp - int

Returns

int

as_days

Returns the number of full days that pass in millis milliseconds.

Arguments

millis - int

Returns

int

as_days_flt

Returns the number of weeks that pass in millis milliseconds.

Arguments

millis - (int | float)

Returns

float

as_hour_of_day

Returns the number of full hours passed since the start of the current day at the moment that is timestamp milliseconds after the 1st of January, 1 AD at 00:00.

Arguments

timestamp - int

Returns

int

as_hours

Returns the number of full hours that pass in millis milliseconds.

Arguments

millis - int

Returns

int

as_hours_flt

Returns the number of hours that pass in millis milliseconds.

Arguments

millis - (int | float)

Returns

float

as_local

Arguments

utc_tz_timestamp - int

Returns

int

as_milli_of_second

Returns the number of full milliseconds passed since the start of the current second at the moment that is timestamp milliseconds after the 1st of January, 1 AD at 00:00.

Arguments

timestamp - int

Returns

int

as_minute_of_hour

Returns the number of full minutes passed since the start of the current hour at the moment that is timestamp milliseconds after the 1st of January, 1 AD at 00:00.

Arguments

timestamp - int

Returns

int

as_minutes

Returns the number of full minutes that pass in millis milliseconds.

Arguments

millis - int

Returns

int

as_minutes_flt

Returns the number of minutes that pass in millis milliseconds.

Arguments

millis - (int | float)

Returns

float

as_month_of_year

Returns the number of full months passed since the start of the current year at the moment that is timestamp milliseconds after the 1st of January, 1 AD at 00:00. If timestamp was the number of milliseconds that passed since the 1st of January, 1 AD at 00:00 on the 3rd of February, 1973 at 23:05:13, that would result in 1 being returned.

Arguments

timestamp - int

Returns

int

as_second_of_minute

Returns the number of full seconds passed since the start of the current minute at the moment that is timestamp milliseconds after the 1st of January, 1 AD at 00:00.

Arguments

timestamp - int

Returns

int

as_seconds

Returns the number of full seconds that pass in millis milliseconds.

Arguments

millis - int

Returns

int

as_seconds_flt

Returns the number of seconds that pass in millis milliseconds.

Arguments

millis - (int | float)

Returns

float

as_utc

Arguments

local_tz_timestamp - int

Returns

int

as_weeks

Returns the number of full weeks that pass in millis milliseconds.

Arguments

millis - int

Returns

int

as_year_ad

Returns the number of full years that have passed timestamp milliseconds after the 1st of January, 1 AD at 00:00. If timestamp was the number of milliseconds that passed since the 1st of January, 1 AD at 00:00 on the 3rd of February, 1973 at 23:05:13, that would result in 1972 being returned.

Arguments

timestamp - int

Returns

int

date

Computes the time passed since the 1st of January, 1 AD at 00:00 on the dayth day of the monthth month of the year year AD (all 1-indexed) at 00:00.

Arguments

day - int

month - int

year - int

Returns

int

date_time

Computes the time passed since the 1st of January, 1 AD at 00:00 on the dayth day of the monthth month of the year year AD (all 1-indexed) at hour:minute:second.

Arguments

day - int

month - int

year - int

hour - int

minute - int

second - int

Returns

int

days

Returns the number of milliseconds that pass in d days.

Arguments

d - int

Returns

int

display_day

Displays the English ordinal 1-indexed number of the given 0-indexed day day. If day was 5, that would result in "6th" being returned.

Arguments

day - int

Returns

str

display_month

Returns the full English name of the month that is month months after the start of the year (0-indexed).

Arguments

month - int

Returns

str

display_weekday

Returns the full English name of the weekday that is day days after the start of the week (0-indexed).

Arguments

day - int

Returns

str

format_date

In the context of the moment that is timestamp milliseconds after the 1st of January, 1 AD at 00:00, returns pattern, replacing {day} with the named current day of the month, {weekday} with the named current day of the week, {month} with the named current month of the year, [second] with the current second of the minute, [minute] with the current minute of the hour, [hour] with the current hour of the day, [day] with the current day of the month, [month] with the current month of the year and [year] with the current year. A traditional US-style pattern would look like "[month]/[day]/[year] [hour]:[minute]:[second]".

Arguments

timestamp - int

pattern - str

Returns

str

hours

Returns the number of milliseconds that pass in h hours.

Arguments

h - int

Returns

int

is_leap_year

Returns true if the year that is no_of_years_passed_ad years after the year 1 AD is a leap year. If no_of_years_passed_ad is 2019, that would correspond to the year 2020 AD, which was a leap year, resulting in true being returned.

Arguments

no_of_years_passed_ad - int

Returns

bool

minutes

Returns the number of milliseconds that pass in m minutes.

Arguments

m - int

Returns

int

now_local

Returns the number of millseconds since the 1st of January, 1 AD at 00:00 in local time.

Arguments

Returns

int

now_utc

Returns the number of millseconds since the 1st of January, 1 AD at 00:00 in UTC.

Arguments

Returns

int

seconds

Returns the number of milliseconds that pass in s seconds.

Arguments

s - int

Returns

int

unix_epoch

Returns the number of milliseconds passed since the 1st of January, 1 AD at 00:00 on the 1st of January, 1970 at 00:00.

Arguments

Returns

int

weeks

Returns the number of milliseconds that pass in w weeks.

Arguments

w - int

Returns

int