GWT Time / Line Formatting

How can I do the following in GWT? (The code below is illegal as it is String.formatnot emulated.)

long lTime = System.currentTimeMillis() % (24*60*60*1000);
long lHour = lTime/(60*60*1000);
long lMin = lTime/(60*1000)%60;
long lSec = lTime/1000%60;
long lMilli = lTime%1000;
return String.format("%d.%.2d:%.2d.%.4d", lHour, lMin, lSec, lMilli);
+3
source share
1 answer

You should use Date(yes, most of its methods are deprecated, but this is what the GWT team chose) andDateTimeFormat

+3
source

Source: https://habr.com/ru/post/1750297/


All Articles