Commit b83c4cd3 authored by sewardj's avatar sewardj
Browse files

[project @ 2001-09-18 12:23:02 by sewardj]

Make this less fragile.  Was failing sometime on Windoze.
parent 39b2e47e
......@@ -3,16 +3,14 @@ import Time
main :: IO ()
main = do
time <- getClockTime
let l = length (show time)
print (l == 28 || l == 29) -- "CEST" vs "UTC" vs "GMT" vs...
print (plausible (show time))
let (CalendarTime year month mday hour min sec psec
wday yday timezone gmtoff isdst) = toUTCTime time
time2 = wdays !! fromEnum wday ++
(' ' : months !! fromEnum month) ++
(' ' : shows2 mday (' ' : shows2 hour (':' : shows2 min (':' : shows2 sec
(' ' : timezone ++ ' ' : shows year "\n")))))
l2 = length time2
print (l == 28 || l == 29)
print (plausible time2)
where
wdays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
......@@ -22,3 +20,5 @@ main = do
pad2 x = case show x of
c@[_] -> '0' : c
cs -> cs
plausible str = filter (== ':') str == "::"
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment