dtm - Date time module

Module Description

The dtm module implements words for using [gregorian] date and time.

Module Words

Date time structure

dtm% ( - n )
Get the required space for the dtm data structure

Constants

dtm.unix-epoch ( - n )
Unix epoch [1970]

dtm.start-epoch ( - n )
Start epoch [1583]

dtm.sunday ( - n )
Sunday

dtm.monday ( - n )
Monday

dtm.tuesday ( - n )
Tuesday

dtm.wednesday ( - n )
Wednesday

dtm.thursday ( - n )
Thursday

dtm.friday ( - n )
Friday

dtm.saturday ( - n )
Saturday

dtm.january ( - n )
January

dtm.february ( - n )
February

dtm.march ( - n )
March

dtm.april ( - n )
April

dtm.may ( - n )
May

dtm.june ( - n )
June

dtm.july ( - n )
July

dtm.august ( - n )
August

dtm.september ( - n )
September

dtm.october ( - n )
October

dtm.november ( - n )
November

dtm.december ( - n )
December

Date time structure creation, initialisation and destruction

dtm-init ( w:dtm - )
Initialise the structure with the current date and time

dtm-create ( C: "name" - R: - w:dtm )
Create a date/time structure with the current date/time

dtm-new ( - w:dtm )
Allocate a date/time structure with the current date/time on the heap

dtm-free ( w:dtm - )
Free the structure from the heap

Module words

dtm+leap-year? ( n:year - f )
Check if the year is a leap year

dtm+calc-leap-years ( n:end n:start - n )
Calculate the number of leap years in a year range

dtm+days-in-year ( n:year - n )
Get the number of days in a year

dtm+days-in-month ( n:month n:year - n )
Get the number of days in a month

dtm+days-till-month ( n:month n:year - n )
Get the number of days till the month

dtm+milli? ( n:millis - f )
Check if milliseconds are valid

dtm+second? ( n:seconds - f )
Check if seconds are valid

dtm+minute? ( n:minutes - f )
Check if minutes are valid

dtm+hour? ( n:hour - f )
Check if hours are valid

dtm+day? ( n:day n:month n:year - f )
Check if the day is valid

dtm+month? ( n:month - f )
Check if the month is valid

dtm+year? ( n:year - f )
Check if the year [>1582] is valid

Member words

dtm-milli@ ( w:dtm - n )
Get the milliseconds

dtm-milli! ( n w:dtm - )
Set the milliseconds

dtm-second@ ( w:dtm - n )
Get the seconds

dtm-second! ( n w:dtm - )
Set the seconds

dtm-minute@ ( w:dtm - n )
Get the minutes

dtm-minute! ( n w:dtm - )
Set the minutes

dtm-hour@ ( w:dtm - n )
Get the hour

dtm-hour! ( n w:dtm - )
Set the hour

dtm-day@ ( w:dtm - n )
Get the day

dtm-day! ( n w:dtm - )
Set the day

dtm-month@ ( w:dtm - n )
Get the month

dtm-month! ( n w:dtm - )
Set the month

dtm-year@ ( w:dtm - n )
Get the year

dtm-year! ( n w:dtm - )
Set the year

Set words

dtm-set-date ( n:day n:month n:year w:dtm - )
Set the date

dtm-set-time ( n:mili n:sec n:min n:hour w:dtm - )
Set the time

dtm-set ( n:mili n:sec n:min n:hour n:day n:month n:year w:dtm - )
Set the date/time

dtm-set-now ( w:dtm - )
Set the date time with the current date/time

dtm-set-with-days ( d:days n:epoch w:dtm - )
Set the date with days since epoch

dtm-set-with-seconds ( d:secs n:epoch w:dtm - )
Set the date/time with seconds since epoch

Get words

dtm-get ( w:dtm - n:mili n:sec n:min n:hour n:day n:month n:year )
Get the date/time

dtm-get-date ( w:dtm - n:day n:month n:year )
Get the date

dtm-get-time ( w:dtm - n:mili n:sec n:min n:hour )
Get the time

dtm-weekday ( w:dtm - n )
Get the week day from the date

dtm-yearday ( w:dtm - n )
Get the day number [in the year] from the date

dtm-iso-weeknumber ( w:dtm - n:weeknumber n:year )
Get the iso week number from the date

Epoch words

dtm-calc-days-since-epoch ( n:epoch w:dtm - d )
Calculate the number of days since epoch from the date

dtm-calc-seconds-since-epoch ( n:epoch w:dtm - d )
Calculate the number of seconds since epoch from the date/time

Compare words

dtm-compare ( n:mili n:sec n:min n:hour n:day n:month n:year w:dtm - n )
Compare the date/time

dtm^compare ( w:dtm w:dtm - n )
Compare two date/times

Inspection

dtm-dump ( w:dtm - )
Dump the date/time structure


generated 09-Jan-2007 by ofcfrth-0.2.0