Ticket #1550 (closed bug: fixed)

Opened 6 years ago

Last modified 4 years ago

Data.Time.formatTime "%S" includes fractional seconds

Reported by: guest Owned by:
Priority: normal Milestone:
Component: libraries (other) Version: 6.6.1
Keywords: time library documentation Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description

from the Haddock: %S second, without decimal part, 00 - 60

Prelude Locale Data.Time> getZonedTime >>= return . formatTime defaultTimeLocale "%S" Loading package time-1.0 ... linking ... done. "32.332216"

Shouldn't that return just "32" ? Or is there another way of stripping the decimals?

Tested on Ubuntu Feisty Fawn and ghc 6.6

% ghc-pkg list time /usr/lib/ghc-6.6/package.conf:

time-1.0

Change History

Changed 6 years ago by guest

  • status changed from new to closed
  • resolution set to fixed

I am pretty sure this was fixed in time-1.1.

Prelude Data.Time Locale> getZonedTime >>= return . formatTime defaultTimeLocale "%S" Loading package time-1.1.1 ... linking ... done. "08"

I think ghc 6.6 has time-1.0, and ghc 6.6.1 has time-1.1?

Changed 6 years ago by guest

Indeed, installing time-1.1.1 fixed it. Thanks!

I'll grab GHC 6.6.1 when it gets into rotation.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.