amir-jakoby / crawler-commons

Automatically exported from code.google.com/p/crawler-commons
0 stars 0 forks source link

AbstractSiteMaps lastmod date not taking time #67

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.print sitemap object.

What is the expected output? What do you see instead?
Expected 2004-12-23T18:00:15+00:00
actual: 2004-12-23Txx:xx:xx-08:00

What version of the product are you using? On what operating system?
any OS, openjdk 1.6

Please provide any additional information below.
SimpleDateFormat Strings are not matching
2004-12-23T18:00:15+00:00
using javax.xml.bind.DatatypeConverter.parseDateTime(date);
solves problem for me
Sorry for reporting if it is already resolved.

Original issue reported on code.google.com by soniyk40...@gmail.com on 23 Mar 2015 at 2:02

GoogleCodeExporter commented 8 years ago
I am using version 0.5

Original comment by soniyk40...@gmail.com on 23 Mar 2015 at 2:17

GoogleCodeExporter commented 8 years ago
Hi there - thanks for reporting the issue. It's actually several issues in 
one...the priority of patterns is wrong (the simple pattern of just yyyy-MM-dd 
will match first), and the patterns being used won't work for the W3C date 
formats that have +/- hh:mm for the timezone offset.

Original comment by kennethk...@gmail.com on 27 Mar 2015 at 7:18

GoogleCodeExporter commented 8 years ago
Fixed in r164. I was able to use 
javax.xml.bind.DatatypeConverter.parseDateTime, except that it (incorrectly) 
doesn't handle the W3C format where there's no seconds (just hours/minutes) for 
the time...so I had to special case that.

Original comment by kennethk...@gmail.com on 27 Mar 2015 at 9:17

GoogleCodeExporter commented 8 years ago

Original comment by kkrugler...@transpac.com on 27 Mar 2015 at 9:18