Show the epoch: Difference between revisions

added haskell
(add scala)
(added haskell)
Line 92:
Output:
<pre>Thu Jan 1 00:00:00 UTC 1970</pre>
 
=={{header|Haskell}}==
===Old time library===
The <code>ClockTime</code> type is abstract in Haskell 98, but is defined in GHC.
{{works with|GHC}}
<lang haskell>import System.Time
 
main = putStrLn $ calendarTimeToString $ toUTCTime $ TOD 0 0</lang>
 
Output:
<pre>Thu Jan 1 00:00:00 UTC 1970</pre>
 
===New time library===
{{works with|GHC}}
<lang haskell>import Data.Time
 
main = print $ UTCTime (ModifiedJulianDay 0) 0</lang>
 
Output:
<pre>1858-11-17 00:00:00 UTC</pre>
 
=={{header|Icon}} and {{header|Unicon}}==
Anonymous user