X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Rakka.git;a=blobdiff_plain;f=Rakka%2FW3CDateTime.hs;h=595d228aee22db29c63951c95af21bf91113145e;hp=85af47a8e7f54feba299eef30d3dd5015ed6a9dd;hb=43113f26d3e61c96d896724c5509abe67b6a99e7;hpb=9c2fc861f3ed609ebb4d0f135aea38ca055bbea8 diff --git a/Rakka/W3CDateTime.hs b/Rakka/W3CDateTime.hs index 85af47a..595d228 100644 --- a/Rakka/W3CDateTime.hs +++ b/Rakka/W3CDateTime.hs @@ -23,13 +23,13 @@ formatW3CDateTime zonedTime timeOfDay = localTimeOfDay localTime (secInt, secFrac) = properFraction (todSec timeOfDay) in - (printf "%04d-%02d-%02dT%02d:%02d:%02d" - year - month - day - (todHour timeOfDay) - (todMin timeOfDay) - (secInt :: Int)) + printf "%04d-%02d-%02dT%02d:%02d:%02d" + year + month + day + (todHour timeOfDay) + (todMin timeOfDay) + (secInt :: Int)) ++ (if secFrac == 0 then "" @@ -38,9 +38,9 @@ formatW3CDateTime zonedTime formatTimeZone :: TimeZone -> String formatTimeZone tz = case timeZoneMinutes tz of - offset | offset < 0 -> '-':(showTZ $ negate offset) + offset | offset < 0 -> '-' : (showTZ $ negate offset) | offset == 0 -> "Z" - | otherwise -> '+':(showTZ offset) + | otherwise -> '+' : showTZ offset showTZ :: Int -> String showTZ offset @@ -50,7 +50,7 @@ formatW3CDateTime zonedTime show2 hour ++ ":" ++ show2 minute show2 :: Int -> String - show2 n | n < 10 = '0':(show n) + show2 n | n < 10 = '0' : show n | otherwise = show n