Parsing date with Joda with time zone

前端 未结 4 1029
清酒与你
清酒与你 2021-01-01 21:25

I have two timestamps which describe the same instant of time in two different formats.

2010-10-03 18:58:07 and 2010-10-03T16:58:07.000+02:00

4条回答
  •  爱一瞬间的悲伤
    2021-01-01 22:09

    If your default time zome is Europe/Berlin, 2010-10-03 18:58:07 corresponds to 2010-10-03T16:58:07.000+00:00.

    You probably misunderstand the time zone field in the string representation. Your time stamp 2010-10-03T16:58:07.000+02:00 means that "it is 16:58:07 in a time zone with a +2 hour offset from GMT), or in an other wording "it is now 16:58:07 in Berlin". I assume that you expected it to mean that it's 16:58:07 GMT?

提交回复
热议问题