in this section : Date | Time

Dates

RPN-enh can handle Julian Day, Julian Calendar and Gregorian Calendar date format.
Basic operations are supported between all these date formats.

Entering a date

Julian Day

To enter a julian day, just enter the JD on the stack and use the >JD function
Ex.: 245300.5 >JD will give <JD 2453000.5>

Calandar date

Common usage is to enter date year, month and day into a list and to convert it with List->DT. the resulting date will be displayed in an Automatic date format (Julian/Gregorian).
Ex.: {2003 12 31} List->DT will give <GR 2003-12-31 0:0:0 >
Ex.: {1000 12 31} List->DT will give <JU 1000-12-31 0:0:0 >
As you see the "automatic date format" switchs from Gregorian to Julian calendar for date below JD=2299159.5 (julian cal. stops at 4th of Oct 1582 and Greg cal. start at 15th of Oct 1582, see here for detail)

Proleptic Julian calendar

You can convert and use Julian date after JD=2299159.5, that's what is called proleptic calendar. The functions are ListJ->DT DT->ListJ works like List->DT and DT->List with Julian date.
See example

Notations

Here are the different date notations in RPNenh :
<JD 2453000.5 >This is the Julian Day Notation, use >JD to display date in this way.
<GR 2003-12-27  0:0:0 >This is the Automatic Calendar Notation (here date is Gregorian), use >CAL to display date in this way.
<JU 1000-12-27  0:0:0 >This is the Automatic Calandar Notation (here date is Julian), use >CAL to display date in this way.
<JUL 2003-12-27  0:0:0 >This is the Proleptic Julian Calendar Notation, use >JUL to display date in this way.
These functions : >JD,>CAL and >JUL change the mode dates are displayed, theses functions can be found in the base menu.

BCE/Negative years

There are two way to handle BCE dates (Before Common Erea/Before Christ) :
I choose to take Astronomic point of view, that means a zero year exist and is equivalent to BCE 1.
if you see <JU -1-9-25 0:0:0> that mean the year is 2 BCE.

Operations

You can know difference between too date, just use the minus -.
Ex.: <GR 2003-12-27> <GR 2002-04-29> - gives 607. There are 607 days between these two dates.

You can add or remove days to a date. with + and -
Ex.: (add 5 days to a date) <GR 2003-12-27> 5 + gives <GR 2004-1-1>

You can add or remove hours:minutes:seconds to a date. with + and -
Ex.: (add 5 hours to a date) <GR 2003-12-27 0:0:0> 5:0:0 + gives <GR 2003-12-27 5:0:0>

Basic Date functions

function usage example
Date Gives the current system date Date gives <GR 27-12-2003  0:0:0 >
DayWeek Gives the day of the week
0:Sunday , 1:Monday...
<GR 27-12-2003  0:0:0 > DayWeek gives 6
WeekNr give the day of the week <GR 27-12-2003  0:0:0 > WeekNr gives 52
List->DT
DT->List
convert date from/to a list
{ yyyy mm dd }
ListJ->DT
DT->ListJ
convert date from/to a list
{ yyyy mm dd } in Julian (proleptic)
DTFormat Format a date into a string details and examples

Validity ranges

Leap year : Leap year have been successfully tested for the given ranges.


Time

Entering a time

To enter a time object (hour:minute:second) you just have to type it.
Example : entering 6:30, type 6:30ENTER
Example : entering 15 seconds 0:0:15, type 0:0:15ENTER (note, you can also type ::15)

You may notify that a popup field will be displayed while you type a time (at the moment you type :)
This is normal, just continue to type...

Note : before the : numbers are displayed as usual number :



Basic Time Operations

You can add+ or substract- time,
Example : 10:0:0 0:10 - gives 9:50

You can add/substract time to a date, see here for example