0

Does JODA DateTime provide a correct date and time as per daylight saving approach?

or we need to add/subtract difference hour count from date

 String DATE_FORMAT = "dd-MM-yyyy hh:mm:ss a";
 SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT);

 Date currentTime = new Date(); 
 String dateToday = formatter.format(currentTime);
 Date date = formatter.parse(dateToday);

 DateTime dt = new DateTime(date);
 DateTimeZone dtZone = DateTimeZone.forID("America/New_York");  
 DateTime dtus = dt.withZone(dtZone); //last line
StackedQ
  • 3,999
  • 1
  • 27
  • 41
  • What's the question exactly? It looks like you're asking a question in the title but not in the question itself – Baksteen May 29 '18 at 12:21
  • 1
    Joda Time certainly knows how to deal with daylight savings; this is not something that you would normally need to do yourself. What specific problem do you have? If you explain in more detail what exactly you want to do, someone might be able to help you with it. – Jesper May 29 '18 at 12:38

0 Answers0