Show the epoch: Difference between revisions

Line 338:
<pre>
BC 4713-01-01 PM 12:00:00.000 (Mon) Coordinated Universal Time
</pre>
Frink also makes it easy to work with date/time values referenced to any arbitrary epoch. For example, to find the number of nanoseconds since the UNIX epoch:
<syntaxhighlight lang="frink">epoch = # 1970 UTC #
now[] - epoch -> ns
</syntaxhighlight>
{{out}}
<pre>
1665439770353000000
</pre>
Or to add a number of seconds to the UNIX epoch and find the result in Japan's timezone:
<syntaxhighlight lang="frink">epoch = # 1970 UTC #
epoch + 2 billion seconds -> Japan
</syntaxhighlight>
{{out}}
<pre>
AD 2033-05-18 PM 12:33:20.000 (Wed) Japan Standard Time
</pre>
 
Leap seconds are usually not taken into account in these calculations, but they can be easily using [https://frinklang.org/#LeapSeconds Frink's leap-second functions.]
 
=={{header|FutureBasic}}==
494

edits