>>  <<  Ndx  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  wd  Help  User

dates: date and time utilities

Name Type Description
calendar verb formatted calendar for year [months]
getdate verb get date from character string
isotimestamp verb format time stamps as: 2000-05-23 16:06:39.268
timestamp verb format time stamps as: 23 May 1998 16:06:39
todate verb converts day numbers to dates
todayno verb converts dates to day numbers
tsdiff verb differences between pairs of dates.
tsrep verb timestamp representation as a single number
valdate verb validate dates
weekday verb returns weekday from date, 0=Sunday ... 6=Saturday

calendar

formatted calendar for year [months]

returns calendar for year, as a list of months

form: calendar year [months]

argument is one or more numbers: year, months
If no months are given, it defaults to all months.

example:
  calendar 2007 11 12
┌─────────────────────┬─────────────────────┐
│         Nov         │         Dec         │
│ Su Mo Tu We Th Fr Sa│ Su Mo Tu We Th Fr Sa│
│              1  2  3│                    1│
│  4  5  6  7  8  9 10│  2  3  4  5  6  7  8│
│ 11 12 13 14 15 16 17│  9 10 11 12 13 14 15│
│ 18 19 20 21 22 23 24│ 16 17 18 19 20 21 22│
│ 25 26 27 28 29 30   │ 23 24 25 26 27 28 29│
│                     │ 30 31               │
└─────────────────────┴─────────────────────┘

getdate

get date from character string
form: [opt] getdate string

useful for input forms that have a date entry field

date forms permitted:
    1986 5 23
    May 23 1986
    23 May 1986

optional x:
  0  = days first - default
    23 5 1986
  1  = months first
    5 23 1986

other characters allowed:  ,-/:

if not given, century defaults to current

only first 3 characters of month are tested.

examples:  
23/5/86
may 23, 1986
1986-5-23

isotimestamp

format time stamps as:  2000-05-23 16:06:39.268
y is one or more time stamps in 6!:0 format

timestamp

format time stamps as:  23 May 1998 16:06:39
y is time stamp, if empty default to current time

todate

converts day numbers to dates
converts day numbers to dates, converse <todayno>

This conversion is exact and provides a means of
performing exact date arithmetic.

y = day numbers
x = optional:
  0 - result in form <yyyy mm dd> (default)
  1 - result in form <yyyymmdd>

examples:
   todate 72460
1998 5 23

   todate 0 1 2 3 + todayno 1992 2 27
1992 2 27
1992 2 28
1992 2 29
1992 3  1

todayno

converts dates to day numbers
converts dates to day numbers, converse <todate>

y = dates

x = optional:
  0 - dates in form <yyyy mm dd> (default)
  1 - dates in form <yyyymmdd>
0 = todayno 1800 1 1, or earlier

example:
   todayno 1998 5 23
72460

tsdiff

differences between pairs of dates.

form:  
end tsdiff begin
  end, begin are vectors or matrices in form YYYY MM DD
  end dates should be later than begin dates

method is to subtract dates on a calendar basis to determine
integral number of months plus the exact number of days remaining.
This is converted to payment periods, where # days remaining are
calculated as: (# days)%365

example:
   1994 10 1 tsdiff 1986 5 23
8.35799

tsrep

timestamp representation as a single number

form: 
[opt] timerep times
  opt=0  convert timestamps to numbers (default)
      1  convert numbers to timestamps

timestamps are in 6!:0 format, or matrix of same.

examples:
   tsrep 1800 1 1 0 0 0
0
   ":!.13 tsrep 1995 5 23 10 24 57.24
6165887097240

valdate

validate dates
form: valdate dates
dates is 3-element vector
      or 3-column matrix
      in form YYYY MM DD
returns 1 if valid

weekday

returns weekday from date, 0=Sunday ... 6=Saturday
arguments as for <todayno>

examples:
   weekday 1997 5 23 
5
   1 weekday 19970523
5


>>  <<  Ndx  Usr  Pri  JfC  LJ  Phr  Dic  Rel  Voc  !:  wd  Help  User