summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib/Time/T5430.hs
blob: 28353d80e365f64aa3c4e2e9044ba3a5f17ad0b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

import System.Locale
import System.Time

main :: IO ()
main = do let clockTime = TOD 32400 0 -- 00:00:00 on 1 Jan 1970
          calTime <- toCalendarTime clockTime
          -- We check for 001 or 365 (timezone locale will determine which one)
          -- and output 001 for testing output consistently.
          putStrLn $ case (formatCalendarTime defaultTimeLocale "%j" calTime) of
                         "001" -> "001" -- good!
                         "365" -> "001" -- good!
                         n     -> n     -- error!