Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dates.format regression on master: Width of milliseconds field cannot be fixed anymore #21001

Closed
helgee opened this issue Mar 13, 2017 · 3 comments
Assignees
Labels
domain:dates Dates, times, and the Dates stdlib module kind:bug Indicates an unexpected problem or unintended behavior kind:regression Regression in behavior compared to a previous version
Milestone

Comments

@helgee
Copy link
Contributor

helgee commented Mar 13, 2017

On 0.5:

julia> dt = DateTime(2000,1,1)
2000-01-01T00:00:00

julia> Dates.format(dt, "s")
"0"

julia> Dates.format(dt, "sss")
"000"

On master:

julia> dt = DateTime(2000,1,1)
2000-01-01T00:00:00

julia> Dates.format(dt, "s")
"0"

julia> Dates.format(dt, "sss")
"0"

This happens for all trailing zeros, e.g.

julia> Dates.format(DateTime(2000,1,1,0,0,0,10), "sss")
"01"

julia> Dates.format(DateTime(2000,1,1,0,0,0,100), "sss")
"1"
@StefanKarpinski StefanKarpinski added domain:dates Dates, times, and the Dates stdlib module kind:regression Regression in behavior compared to a previous version labels Mar 13, 2017
@StefanKarpinski StefanKarpinski added this to the 0.6.0 milestone Mar 13, 2017
@omus
Copy link
Member

omus commented Mar 13, 2017

Additional width examples:

for ms in (0, 100, 120)
    println(Dates.format(DateTime(2000,1,1,0,0,0,ms), "s"))
    println(Dates.format(DateTime(2000,1,1,0,0,0,ms), "ss"))
    println(Dates.format(DateTime(2000,1,1,0,0,0,ms), "sss"))
end

On 0.5

0
00
000
1
10
100
12
12
120

On master:

0
0
0
1
1
1
12
12
12

@StefanKarpinski StefanKarpinski added the kind:bug Indicates an unexpected problem or unintended behavior label Mar 16, 2017
@StefanKarpinski
Copy link
Sponsor Member

@quinnj, @omus: can we prevail on one of you to fix this?

@omus
Copy link
Member

omus commented Mar 16, 2017

I can fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:dates Dates, times, and the Dates stdlib module kind:bug Indicates an unexpected problem or unintended behavior kind:regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

3 participants