Skip to content

Instantly share code, notes, and snippets.

@abh1nav
Created November 14, 2012 20:18
Show Gist options
  • Save abh1nav/4074498 to your computer and use it in GitHub Desktop.
Save abh1nav/4074498 to your computer and use it in GitHub Desktop.
ISO Date Time String to Joda DateTime
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
public class ISODateParsing {
public static void main(String[] args) {
DateTimeFormatter parser = ISODateTimeFormat.dateTimeNoMillis();
String str = "2012-01-01T00:00:00-0500";
DateTime dt = parser.parseDateTime(str);
System.out.println(dt);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment