[commit: packages/time] master, wip/travis: midnight and midday (5564e25)
git at git.haskell.org
git at git.haskell.org
Sat May 7 06:40:12 UTC 2016
Repository : ssh://git@git.haskell.org/time
On branches: master,wip/travis
Link : http://git.haskell.org/packages/time.git/commitdiff/5564e2557b48670109ae4ef8bc3cd1c72793ecf8
>---------------------------------------------------------------
commit 5564e2557b48670109ae4ef8bc3cd1c72793ecf8
Author: Ashley Yakeley <ashley at semantic.org>
Date: Thu Apr 28 02:45:26 2005 -0700
midnight and midday
darcs-hash:20050428094526-ac6dd-6f5c7b8db227357b86d1f1c71d1e119404c7e985
>---------------------------------------------------------------
5564e2557b48670109ae4ef8bc3cd1c72793ecf8
System/Time/Calendar.hs | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/System/Time/Calendar.hs b/System/Time/Calendar.hs
index c5aea12..fa91928 100644
--- a/System/Time/Calendar.hs
+++ b/System/Time/Calendar.hs
@@ -8,8 +8,11 @@ module System.Time.Calendar
-- getting the locale time zone
getTimezone,getCurrentTimezone,
+ -- TimeOfDay
+ TimeOfDay(..),midnight,midday,
+
-- Gregorian "calendrical" format
- TimeOfDay(..),CalendarDay(..),CalendarTime(..),
+ CalendarDay(..),CalendarTime(..),
dayToCalendar,calendarToDay,
-- converting UTC times to Gregorian "calendrical" format
@@ -76,6 +79,12 @@ data TimeOfDay = TimeOfDay {
todSec :: Pico
} deriving (Eq,Ord)
+midnight :: TimeOfDay
+midnight = TimeOfDay 0 0 0
+
+midday :: TimeOfDay
+midday = TimeOfDay 12 0 0
+
show2 :: Int -> String
show2 i = let
s = show i in
More information about the ghc-commits
mailing list