purescript-contrib/purescript-formatters

support two digits month

Closed this issue · 1 comments

Hi,

I'm not sure if I'm using a wrong method or miss anything, I expect the following code will print
2017-01-05 07:15:49
but I got:
2017-1-5 7:15:49

Can I get some help? Thanks

import Data.Formatter.DateTime as FDT
import Data.DateTime
import Data.DateTime.Instant
import Data.Either

main = do
  instant <- now
  let d = toDateTime instant
  case FDT.parseFormatString "YYYY-MM-DD HH:mm:ss" <#> flip FDT.format d of
    Left error -> log error
    Right f -> log f
garyb commented

Looks like a bug to me!