... the user friendly GPS tool


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
24 hour clock? Is it possible?
#9
(24.02.2011, 01:59)RsH Wrote: I hope one of the following solves the problem... you have to figure it out, as I do NOT know these programming languages..

Thank you for your help, but I guess I have to find a way around Java date formatting.

(24.02.2011, 01:59)RsH Wrote: Someone else suggested:

1 public static DateTime ConvertTime(long timeAsInteger)
2 {
3 double time = Convert.ToDouble(timeAsInteger) / 100;
4 DateTime baseDate = new DateTime(1970, 1, 1);
5 DateTime result = baseDate + TimeSpan.FromSeconds(time);
6 return result;
7 }

If 'I' pass in 117969553301 'I' get the answer 20/05/2007 21:12:13 (that's UK date format...)
Not sure whether it will help, but it's very close to 5/21/2007 00:12:13.
It's a very strange DateTime encoding though!!

That looks like C# which doesn't help me since I'm using Java. It looks pretty straight forward:

private static final DateFormat TIME_FORMAT = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
static {
TIME_FORMAT.setTimeZone(CompactCalendar.UTC);
}

and later you let the DateFormat do the formatting:

CompactCalendar time = position.getTime();
return time != null ? TIME_FORMAT.format(time.getTime()) : "";

So there are 4 options:
  • choosing one date/time format for all languages (not nice)
  • staying with the Locale specific date/time format (nice for most users)
  • choosing a specific date/time format for English and a Locale specific for all other languages (don't know if this is what most users want)
  • doing the date/time stuff on my own (too expensive)

So, I'm kind of stuck...
--
Christian
Reply


Messages In This Thread
24 hour clock? Is it possible? - by RsH - 01.07.2009, 17:03
RE: 24 hour clock? Is it possible? - by RsH - 22.02.2011, 23:32
RE: 24 hour clock? Is it possible? - by RsH - 23.02.2011, 13:29
RE: 24 hour clock? Is it possible? - by RsH - 24.02.2011, 01:59
RE: 24 hour clock? Is it possible? - by routeconverter - 26.02.2011, 17:06
RE: 24 hour clock? Is it possible? - by RsH - 26.02.2011, 17:30

Forum Jump:


Users browsing this thread: 2 Guest(s)