How to resolve the algorithm Show the epoch step by step in the PL/I programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Show the epoch step by step in the PL/I programming language
Table of Contents
Problem Statement
Choose popular date libraries used by your language and show the epoch those libraries use. A demonstration is preferable (e.g. setting the internal representation of the date to 0 ms/ns/etc., or another way that will still show the epoch even if it is changed behind the scenes by the implementers), but text from (with links to) documentation is also acceptable where a demonstration is impossible/impractical. For consistency's sake, show the date in UTC time where possible.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Show the epoch step by step in the PL/I programming language
Source code in the pl/i programming language
*process source attributes xref;
epoch: Proc Options(main);
/*********************************************************************
* 20.08.2013 Walter Pachl shows that PL/I uses 15 Oct 1582 as epoch
* DAYS returns a FIXED BINARY(31,0) value which is the number of days
* (in Lilian format) corresponding to the date d.
*********************************************************************/
Dcl d Char(17);
Put Edit(datetime(),days(datetime()))
(Skip,a,f(15));
d='15821015000000000';
Put Edit(d ,days(d))
(Skip,a,f(15));
d='15821014000000000';
Put Edit(d ,days(d))
(Skip,a,f(15));
End;
You may also check:How to resolve the algorithm Repeat a string step by step in the BBC BASIC programming language
You may also check:How to resolve the algorithm Luhn test of credit card numbers step by step in the Fortran programming language
You may also check:How to resolve the algorithm Call a foreign-language function step by step in the C++ programming language
You may also check:How to resolve the algorithm Averages/Pythagorean means step by step in the JavaScript programming language
You may also check:How to resolve the algorithm Shell one-liner step by step in the Scala programming language