0

How to create another format of time?

My code: Date goodmorning = new Date(); System.out.format("Today is %tA, the %td of %tB. Time %tR" , goodmorning, goodmorning, goodmorning, goodmorning ); My problem: The time lags on 3 hours. For example my time: 22:56,my result: 19:56. What problem in my code? Thanks.

17th Jan 2017, 7:58 PM
Artem
Artem - avatar
1 Antwort
+ 2
Maybe it depends on the timezone of where the Sololearn java server is located. I have a lag of 1 hour.
17th Jan 2017, 8:19 PM
Álvaro