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

TestDateConvert failures with UTC timezone #29

Closed
ebourg opened this issue Aug 2, 2016 · 2 comments
Closed

TestDateConvert failures with UTC timezone #29

ebourg opened this issue Aug 2, 2016 · 2 comments
Assignees
Milestone

Comments

@ebourg
Copy link

ebourg commented Aug 2, 2016

Hi,

I noticed that TestDateConvert has failures if the local timezone is set to UTC. The tests work fine with a timezone set to Europe/Paris.

Running net.minidev.asm.TestDateConvert
can not parse:lundi 23 janvier 2012 13 h 42 UTC - DateFormat.0
java.lang.NumberFormatException: For input string: "UTC"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:580)
        at java.lang.Integer.parseInt(Integer.java:615)
        at net.minidev.asm.ConvertDate.addHour(ConvertDate.java:264)
        at net.minidev.asm.ConvertDate.getDDMMYYYY(ConvertDate.java:229)
        at net.minidev.asm.ConvertDate.convertToDate(ConvertDate.java:139)
        at net.minidev.asm.TestDateConvert.fullTestDate(TestDateConvert.java:75)
        at net.minidev.asm.TestDateConvert.testDateLocalized(TestDateConvert.java:62)
        at net.minidev.asm.TestDateConvert.testDateFRANCE(TestDateConvert.java:43)

can not parse:Montag, 23. Januar 2012 13:42 Uhr UTC - DateFormat.0
java.lang.NumberFormatException: For input string: "UTC"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:580)
        at java.lang.Integer.parseInt(Integer.java:615)
        at net.minidev.asm.ConvertDate.addHour(ConvertDate.java:264)
        at net.minidev.asm.ConvertDate.getDDMMYYYY(ConvertDate.java:229)
        at net.minidev.asm.ConvertDate.convertToDate(ConvertDate.java:139)
        at net.minidev.asm.TestDateConvert.fullTestDate(TestDateConvert.java:75)
        at net.minidev.asm.TestDateConvert.testDateLocalized(TestDateConvert.java:62)
        at net.minidev.asm.TestDateConvert.testDateGERMANY(TestDateConvert.java:51)

testDateCANADA(net.minidev.asm.TestDateConvert)  Time elapsed: 0.007 sec  <<< FAILURE!
junit.framework.ComparisonFailure: expected:<23/01/2012 [13]:42:59> but was:<23/01/2012 [01]:42:59>
        at net.minidev.asm.TestDateConvert.fullTestDate(TestDateConvert.java:83)
        at net.minidev.asm.TestDateConvert.testDateLocalized(TestDateConvert.java:62)
        at net.minidev.asm.TestDateConvert.testDateCANADA(TestDateConvert.java:47)
@UrielCh
Copy link
Contributor

UrielCh commented Mar 25, 2017

fixed.

@UrielCh UrielCh self-assigned this Mar 25, 2017
@UrielCh UrielCh added this to the 2.3 milestone Mar 26, 2017
@UrielCh
Copy link
Contributor

UrielCh commented Mar 26, 2017

after a new update. All java time zone are properly supported.

@UrielCh UrielCh closed this as completed Mar 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants