Read date without timezone information

date, datetime, java, jodatime

Solution

Assuming you are referring to the part of Florida following EST, you can set the timezone for `SimpleDateFormat` and set your TimeZone to EST.

SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
format.setTimeZone(TimeZone.getTimeZone("America/New_York"));
Date date = format.parse("2014-01-30 07:48:25");

Your parsed date now can be utilized by your default `TimeZone` of the system (or set it to your liking as we did in the first place).

TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
System.out.println(date);

The output I get for your date offset to UTC:

Thu Jan 30 12:48:25 UTC 2014

Problem

I receive datetime strings with no timezone qualifier in the format: ``` 2014-01-30 07:48:25 ``` I know that the strings are produced by a server in Florida. Is there a way using java.util or joda Date libs to specify that the date is from Florida then parse it with the appripriate UTC offset, depending on where it falls in the calendar for daylight savings time?

Original source