manual:chapter6:system:cmd_dateadd

Synopsis


Add / subtract a number of days to a date

Stack Diagram


Input Stack Output Stack
Rdate Idays Rnewdate
Level 2 Level 1 Level 1

Legend

Keyword type Command
Parallel list processing capabilities Group 6 Two arguments, one result commands
Affected by flags -42 Date format

Description


The DATE+ command returns a past or future date given a start date and a number of days; if this number is negative, DATE+ calculates a past date. The date is expressed by a real number and its format depends on the state of flag -42:

  • if the flag -42 is set the date is expressed as DD.MMYYYY;
  • if the flag -42 is cleared the date is expressed as MM.DDYYYY.

where:

  • DD is the day;
  • MM is the month;
  • YYYY is the year.

The range of allowable dates is October 15, 1582 to December 31, 9999.

Compatibility


DATE+ is fully equivalent to its userRPL counterpart.

Usage


Input

4:                                      
3:                                      
2:                             10.081984
1:                                  -256
…………………………………………………………………………………………………………
-42 SF DATE+                            


Output

4:                                      
3:                                      
2:                                      
1:                             28.111983
…………………………………………………………………………………………………………
                                        

Related Commands


Time, Alarms and System Commands 28 1 NEW

Command Short Description
→DATE Set current system date in MM.DDYYYY
DATE+ Add days to a date in MM.DDYYYY
→TIME Set current time as HH.MMSS
→HMS Convert decimal time to HH.MMSS
HMS→ Convert time in HH.MMSS to decimal
HMS+ Add time in HH.MMSS format
HMS- Subtract time in HH.MMSS format
TICKS Return system clock in microseconds CHANGED
TEVAL Perform EVAL and measure elapsed time CHANGED
DATE Current system date as MM.DDYYYY
DDAYS Number of days between dates in MM.DDYYYY
TIME Current time in HH.MMSS
TSTR
ACK Acknowledge oldest alarm (dismiss)
ACKALL Acknowledge (dismiss) all alarms
RCLALARM Recall specified alarm
STOALARM Create a new alarm
DELALARM Delete an existing alarm
FINDALARM Get first alarm due after the given time
VERSION Get newRPL version string
MEM Get available memory in bytes
BYTES Size of an object in bytes and CRC32 CHANGED
PEEK Low-level read memory address CHANGED
POKE Low level write to memory address CHANGED
NEWOB Make a new copy of the given object
GARBAGE Force a garbage collection NEW
FWUPD
OFF Turn calculator off programmatically
  • manual/chapter6/system/cmd_dateadd.txt
  • Last modified: 2021/09/22 12:46
  • by jojo1973