Created
November 14, 2012 20:18
-
-
Save abh1nav/4074498 to your computer and use it in GitHub Desktop.
ISO Date Time String to Joda DateTime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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