Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // I want 2008-11-13T12:23:30-08:00
- String timestamp = new SimpleDateFormat("yyyy-MM-dd'T'h:m:ssZ").format(new Date());
- System.out.println(timestamp);
- // prints "2008-11-13T12:23:30-0800" See the difference?
- // Throws a ParseException
- new SimpleDateFormat("yyyy-MM-dd'T'h:m:ssZ").parse("2008-11-13T13:23:30-08:00")
- SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'h:m:ss.SZ");
Add Comment
Please, Sign In to add comment