vladukua / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

Error parsing Date with DateTime #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-api-java-client (e.g. 1.1.0-alpha)? 1.1.0-alpha

Java environment (e.g. Java 6, Android 2.2, App Engine 1.3.7)? 1.6

Describe the problem.
This test currently failed, when hour = 24. Replace hour=24 by hour=0 to solve 
the issue in the parseRfc3339.

DateTime date2 = DateTime.parseRfc3339("2010-10-18T24:31:49Z");
        calendar.setTimeInMillis(date2.value);
        assertEquals(18,calendar.get(GregorianCalendar.DAY_OF_MONTH));

How would you expect it to be fixed?

Original issue reported on code.google.com by olivier....@gmail.com on 18 Oct 2010 at 1:15

GoogleCodeExporter commented 9 years ago
As far as I can tell, 24 is an illegal "time-hour" according to RFC 3339:

http://tools.ietf.org/html/rfc3339#section-5.6

Does your reading of the specification lead you to a different conclusion?

Original comment by yan...@google.com on 18 Oct 2010 at 2:45

GoogleCodeExporter commented 9 years ago
It is a bit of a tricky one. I agree that RFC 3339 does not support 24 as a 
legal hour, but google gmail api return it as part of its feed. 

I wonder if google-api-java-client should support the standard or should work 
with the google api ? 

What is your opinion on this ?

Original comment by olivier....@gmail.com on 18 Oct 2010 at 8:37

GoogleCodeExporter commented 9 years ago
Thanks for reporting the problem.  Let's see if we can report a bug in the 
GMail feed.

Original comment by yan...@google.com on 19 Oct 2010 at 11:39