We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to convert a ISO8601 year'W'week to Unix TimeStamp and have been able to at least convert year'W'week to week starting date and week end date, but haven not figured out how to convert date in to Unix Timetamp. I am using Joda 2.4.
Here is my code:
int year = 2012;
int weekNumber = 8;
LocalDate weekStartDate = new LocalDate().withWeekOfWeekyear(weekNumber).withYear(year);
LocalDate weekEndDate = new LocalDate().withWeekOfWeekyear(weekNumber + 1).withYear(year);
println (weekStartDate+" - "+weekEndDate);
Can anyone help me out?
Answers
anyone?
LocalDate isn't the right object for this task: it doesn't represent a moment in time. After some searches, I had a better result with DateTime:
Thanks for the help!