Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
f6cea70a
Commit
f6cea70a
authored
Jan 12, 2012
by
dterei
Browse files
Fix T5430, make output independent of user timezone
parent
3d52fa8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/lib/Time/T5430.hs
View file @
f6cea70a
...
...
@@ -3,6 +3,12 @@ import System.Locale
import
System.Time
main
::
IO
()
main
=
do
let
clockTime
=
TOD
0
0
-- 00:00:00 on 1 Jan 1970
main
=
do
let
clockTime
=
TOD
3240
0
0
-- 00:00:00 on 1 Jan 1970
calTime
<-
toCalendarTime
clockTime
putStrLn
$
formatCalendarTime
defaultTimeLocale
"%j"
calTime
-- 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!
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment