posted 16 years ago
Hi
I retrieve Calendar objects from a file, and my Calendar object reads the date: 2006-04-05+03:00
if I do a calendar.getTime() to convert the Calendar to a Date, the Date will be: Tue Apr 04 22:00:00 BST 2006 - probably because my timezone is not +03, it's +0.
so instead of having April 5th, I get April 4th.
This is obviously wrong. I found a solution to set the date like this:
and this returns Wed Apr 05 01:00:00 BST 2006
so... still not April 5th 00:00, but the hour is not relevant, only the day is.
My question is: is there a better, maybe a more elegant way to "transform" the Calendar into a Date correctly? A way to ignore the +03:00 part of the Calendar?
Thanks