Easy Date Converter Advanced Version
Using 'today' and 'result'
 

Two "keywords" are available for use in batch files: today and result. The first takes the value of today's date (as read from the PC's system clock). The second takes the value of the result of the previous operation, which may be either the second date or the difference between the first and second dates, and allows chaining of operations, whereby the result of each operation in a series of operations is fed into the next. The use of these two keywords is illustrated in the examples below. The input files for these examples are contained in edca_examples.zip — click on that link to download the file.


Example B1

This demonstrates the use of today in batch files. In this example today is first used alone so as simply to output today's date (preceded by some text). Then today's date is shown in all of the supported calendars. Then some date arithmetic is performed using today's date (in this example, today's date happens to be February 9, 2007). To get the same output the Verbose option should be unchecked and Display day names in the configuration panel should be checked.

Input file Result in output window
//  Example B1

output: This demonstrates;
output: the use of 'today'.
bl

verbose = N

first date = CE
second date = CE
date format = Y-M-D

output: Today is;
today
bl

second date = ISO
today #
second date = JC
today #
second date = ORD
today #
second date = LPM
today #
second date = LPW
today #
second date = JDN
today #
bl

second date = CE
today # 1
today # -1
today # 404
bl

today # # 2009-01-20
today # # 2012-12-21
1914-08-01 # # today
1582-10-14 # # today
This demonstrates the use of 'today'.

Today is 2007-02-09 CE, Friday

2007-02-09 CE = 2007-W06-5 ISO, Friday
2007-02-09 CE = 2007-01-27 JC, Friday
2007-02-09 CE = 2007-040 ORD, Friday
2007-02-09 CE = 2007-02-12 LPM, Friday
2007-02-09 CE = 2007-07-5 LPW, Friday
2007-02-09 CE = 2,454,141 JDN, Friday

2007-02-09 CE plus 1 day = 2007-02-10 CE, Saturday
2007-02-09 CE minus 1 day = 2007-02-08 CE, Thursday
2007-02-09 CE plus 404 days = 2008-03-19 CE, Wednesday

2007-02-09 CE to 2009-01-20 CE = 711 days (1 year, 11 months, 11 days)
2007-02-09 CE to 2012-12-21 CE = 2,142 days (5 years, 10 months, 12 days)
1914-08-01 CE to 2007-02-09 CE = 33,795 days (92 years, 6 months, 8 days)
1582-10-14 CE to 2007-02-09 CE = 154,981 days (424 years, 3 months, 26 days)


Example B2

This demonstrates the use of result in batch files. The basic idea is that result has the value provided by the previous operation. This value may be either the second date (but not the first date) or the difference (in days) between the first date and the second.

In the following example today is used to get today's date, displayed as CE, and then this is cycled through all of the calendars supported, arriving back at the CE date.

To get the same output as below the Verbose option should be unchecked and Display day names in the configuration panel should be checked.

Input file Result in output window
//  Example B2

output: This demonstrates;
output: the use of 'result'.
bl

verbose = N
first date = CE
date format = Y-M-D
hyphen = Y
bl

output: Today is;
today
bl

Output: CE -> ISO
first date = CE
second date = ISO
result #
Output: ISO -> JC
first date = ISO
second date = JC
result #
Output: JC -> ORD
first date = JC
second date = ORD
result #
Output: ORD -> LPM
first date = ORD
second date = LPM
result #
Output: LPM -> LPW
first date = LPM
second date = LPW
result #
Output: LPW -> JDN
first date = LPW
second date = JDN
result #
Output: JDN -> CE
first date = JDN
second date = CE
result #

This demonstrates the use of 'result'.

Ordinal and ISO 8601 Week dates are with hyphen.

Today is 2007-02-09 CE, Friday

CE -> ISO
2007-02-09 CE = 2007-W06-5 ISO, Friday
ISO -> JC
2007-W06-5 ISO = 2007-01-27 JC, Friday
JC -> ORD
2007-01-27 JC = 2007-040 ORD, Friday
ORD -> LPM
2007-040 ORD = 2007-02-12 LPM, Friday
LPM -> LPW
2007-02-12 LPM = 2007-07-5 LPW, Friday
LPW -> JDN
2007-07-5 LPW = 2,454,141 JDN, Friday
JDN -> CE
2,454,141 JDN = 2007-02-09 CE, Friday


Example B3

As stated above, result has the value provided by the previous operation. This value may be either the second date (but not the first date) or the difference (in days) between the first date and the second.

When used in an an operation line the meaning of result depends on its position. If it is in the position of the first date then it means the second date resulting from the previous operation. If it is in the position of the date difference then it means the date difference resulting from the previous operation. This is illustrated in the example given below.

In an operation line result may be using in conjunction with multiplication and division. For example, "1914‑07‑28 # # 1939‑09‑03" gives a certain result for the number of days from the first date to the second. One can then use "1939‑09‑03 # result*2" to add twice that number of days to 1939‑09‑03, and one can use "1939‑09‑03 # ‑result/2" to subtract half that number of days from 1939‑09‑03.

To get the same output as below the Verbose option should be unchecked and Display day names in the configuration panel should be checked.

Input file Result in output window
//  Example B3

output: This demonstrates;
output: the use of 'result'.
bl

verbose = N
date format = Y-M-D

first date = CE
second date = CE

Output: Today is;
today
bl

second date = LPM

Output: Today in both CE and LPM is
today
bl

second date = CE
today # 1
result # 1
result # 1
bl

second date = LPM
today # 1
result # 1
result # 1
bl

second date = CE
today # # 2012-12-21
today # result
today # # 2012-12-21
today # -result
bl

first date = LPM
today # # 2012-12-21
today # result
today # # 2012-12-21
today # -result
bl

first date = CE
1914-07-28 # # 1939-09-03
1939-09-03 # result
1939-09-03 # result*2
1939-09-03 # result*-3
bl

today # # 2035-03-24
today # result/4
today # result/3
today # -result/2
result # result
result # -result
This demonstrates the use of 'result'.

Today is 2007-02-09 CE, Friday

Today in both CE and LPM is
2007-02-09 CE = 2007-02-12 LPM, Friday

2007-02-09 CE plus 1 day = 2007-02-10 CE, Saturday
2007-02-10 CE plus 1 day = 2007-02-11 CE, Sunday
2007-02-11 CE plus 1 day = 2007-02-12 CE, Monday

2007-02-09 CE plus 1 day = 2007-02-13 LPM, Saturday
2007-02-10 CE plus 1 day = 2007-02-14 LPM, Sunday
2007-02-11 CE plus 1 day = 2007-02-15 LPM, Monday

2007-02-09 CE to 2012-12-21 CE = 2,142 days (5 years, 10 months, 12 days)
2007-02-09 CE plus 2,142 days = 2012-12-21 CE, Friday
2007-02-09 CE to 2012-12-21 CE = 2,142 days (5 years, 10 months, 12 days)
2007-02-09 CE minus 2,142 days = 2001-03-30 CE, Friday

2007-02-12 LPM to 2012-12-21 CE = 2,142 days
2007-02-12 LPM plus 2,142 days = 2012-12-21 CE, Friday
2007-02-12 LPM to 2012-12-21 CE = 2,142 days
2007-02-12 LPM minus 2,142 days = 2001-03-30 CE, Friday

1914-07-28 CE to 1939-09-03 CE = 9,168 days (25 years, 1 month, 6 days)
1939-09-03 CE plus 9,168 days = 1964-10-09 CE, Friday
1939-09-03 CE plus 18,336 days = 1989-11-15 CE, Wednesday
1939-09-03 CE minus 27,504 days = 1864-05-14 CE, Saturday

2007-02-09 CE to 2035-03-24 CE = 10,270 days (28 years, 1 month, 15 days)
2007-02-09 CE plus 2,567 days = 2014-02-19 CE, Wednesday
2007-02-09 CE plus 3,423 days = 2016-06-24 CE, Friday
2007-02-09 CE minus 5,135 days = 1993-01-18 CE, Monday
1993-01-18 CE plus 10,270 days = 2021-03-02 CE, Tuesday
2021-03-02 CE minus 10,270 days = 1993-01-18 CE, Monday


Easy Date Converter Advanced Version Main Page
Date/Calendar Software Hermetic Systems Home Page