[commit: packages/time] format-widths, ghc, improve-leapseconds, master, posix-perf, tasty, wip/travis: utcToLocalZonedTime (5f330c5)

git at git.haskell.org git at git.haskell.org
Fri Apr 21 16:45:54 UTC 2017


Repository : ssh://git@git.haskell.org/time

On branches: format-widths,ghc,improve-leapseconds,master,posix-perf,tasty,wip/travis
Link       : http://git.haskell.org/packages/time.git/commitdiff/5f330c5e312131d4fe5abce8fadb79b69601dfd8

>---------------------------------------------------------------

commit 5f330c5e312131d4fe5abce8fadb79b69601dfd8
Author: Ashley Yakeley <ashley at semantic.org>
Date:   Sun Aug 7 15:36:19 2005 -0700

    utcToLocalZonedTime
    
    darcs-hash:20050807223619-ac6dd-e7ba5a92ce87e506014e37539f2b14952f5b47b1


>---------------------------------------------------------------

5f330c5e312131d4fe5abce8fadb79b69601dfd8
 Data/Time/LocalTime/LocalTime.hs | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Data/Time/LocalTime/LocalTime.hs b/Data/Time/LocalTime/LocalTime.hs
index 541a47b..9d718ee 100644
--- a/Data/Time/LocalTime/LocalTime.hs
+++ b/Data/Time/LocalTime/LocalTime.hs
@@ -9,7 +9,7 @@ module Data.Time.LocalTime.LocalTime
 	-- converting UTC and UT1 times to LocalTime
 	utcToLocalTime,localTimeToUTC,ut1ToLocalTime,localTimeToUT1,
 	
-	ZonedTime(..),zonedTimeFromUTC,ztUTC,getZonedTime
+	ZonedTime(..),zonedTimeFromUTC,ztUTC,getZonedTime,utcToLocalZonedTime
 ) where
 
 import Data.Time.LocalTime.TimeOfDay
@@ -70,3 +70,9 @@ getZonedTime = do
 	t <- getCurrentTime
 	zone <- getTimeZone t
 	return (zonedTimeFromUTC zone t)
+
+-- |
+utcToLocalZonedTime :: UTCTime -> IO ZonedTime
+utcToLocalZonedTime t = do
+	zone <- getTimeZone t
+	return (zonedTimeFromUTC zone t)



More information about the ghc-commits mailing list