SimpleDateFormat timezone bug on Android

前端 未结 4 1016
你的背包
你的背包 2020-12-17 21:20

I\'ve been trying to isolate a bug in my application. I succeeded in producing the following \"riddle\":

SimpleDat         


        
4条回答
  •  春和景丽
    2020-12-17 21:43

    Your question intrigued me so I went ahead and compiled your code. The result? As expected...

    2011-12-31T18:00:00+0100
    2011-12-31T18:00:00+0100
    

    The two values are the same, are you using some concurrency? Maybe the variable gets changed on another thread right before the f2.format(d).

提交回复
热议问题