Show the epoch: Difference between revisions

m
(→‎Joy: add)
m (→‎{{header|Wren}}: Minor tidy)
(2 intermediate revisions by 2 users not shown)
Line 491:
On my PC I see
<pre>01.01.1970 00:00:00</pre>
 
===Using Java 8===
Java 8 introduced the classes LocalDate, LocalTime, LoclDateTime,
and other associated classes which simplified the manipulation of dates and times.
<syntaxhighlight lang = "java">
import java.time.LocalDateTime;
import java.time.ZoneOffset;
 
public final class ShowTheEpoch {
 
public static void main(String[] args) {
System.out.println(LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC));
}
 
}
 
</syntaxhighlight>
{{ out }}
<pre>
1970-01-01T00:00
</pre>
 
=={{header|JavaScript}}==
Line 1,006 ⟶ 1,027:
Output:
[[File:CalmoSoftShowEpoch.jpg]]
 
=={{header|RPL}}==
RPL can not go back into the past beyond 15 October 1582.
15.101582 -1 DATE+
{{out}}
<pre>
DATE+ Error:
Bad Argument Value
</pre>
 
=={{header|Ruby}}==
Line 1,171 ⟶ 1,201:
{{libheader|Wren-date}}
The epoch (or zero date/time) for the above module is midnight on 1st January, 0001 UTC according to the Gregorian proleptic calendar, though it can also cater for the Unix epoch as well.
<syntaxhighlight lang="ecmascriptwren">import "./date" for Date
 
Date.default = Date.isoFull
9,482

edits