Jump to content

Date manipulation: Difference between revisions

→‎{{header|Haskell}}: Replaced a functional call that is now deprecated
(→‎{{header|Haskell}}: Replaced a functional call that is now deprecated)
Line 1,118:
=={{header|Haskell}}==
 
<lang haskell>import qualified Data.Time.Clock.POSIX as P
import qualified Data.Time.Format as F
import System.Locale
 
-- UTC from EST
main :: IO ()
main = print t2
where
where t1 = readTime defaultTimeLocale
t1 =
"%B %e %Y %l:%M%P %Z"
F.parseTimeOrError
"March 7 2009 7:30pm EST"
True
t2 = posixSecondsToUTCTime $ 12*60*60 + utcTimeToPOSIXSeconds t1</lang>
where t1 = readTime F.defaultTimeLocale
"%B %e %Y %l:%M%P %Z"
"March 7 2009 7:30pm EST"
t2 = P.posixSecondsToUTCTime $ 12 * 60 * 60 + P.utcTimeToPOSIXSeconds t1</lang>
{{Out}}
<pre>2009-03-08 12:30:00 UTC</pre>
 
=={{header|HicEst}}==
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.