java - Joda - Print DateTime ignoring TimeZones -


i got 2 timestamps:

  • 2015-03-30t00:36:00.000+0100
  • 2015-03-30t00:36:00.000+0200

only timezone differs. after parsing timestamp datetimeformatter , printing time (without date) using datetimeformat.shorttime(). results are:

  • 00:36
  • 23:36

since times matter in case ignore timezones when printing time. how can achieve printing 00:36 both timestamps?

you use fixed-length-format can this:

localdatetime ldt = localdatetime.parse(input, isodatetimeformat.datetimeparser()); system.out.println(ldt.tolocaltime().tostring(isodatetimeformat.hourminute())); // output: 00:36 

i use localdatetime because not interested in timezone offset.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -