Re: replacement for String.format in GWT?
Hi,
I have to explain my real problem with DateFormat:
I need to represent a time span (the time elapsed during a chess
move), not a real date, e. g.:
0000-01-02 03:04:05
means:
0 years, 1 month, 2 days, 3 hours, 4 minutes and 5 seconds.
Such a span is computed by subtracting a date from another date and
stored as a date:
Date d1,d2;
..
long t1 = d1.getTime ();
long t2 = d2.getTime ();
long t = t2 - t1;
Date d = new Date (t);
I cannot format d it with DateFormat, since it is interpreted as an
offset to 1970. If I could supress this interpretation, I would be
glad.
As a workaround, I extracted the date elements as integers and tried
to format them with String.format.
Magnus
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home