Odd, you are right it appears my Time isnt correct...

I have the following code:
        Time time = new Time();
        Log.v("1", "time="+time);
the time that's being printed (via the default time.toString()) is
giving a date in the year 1970. The date on the android phone says the
current date and year....
Does anyone have any idea why this is so?

Any help is appreciated :)

On Sep 8, 12:19 pm, Mark Murphy <[email protected]> wrote:
> Feras wrote:
> > I'm trying to get theJulianDate for the 'current time'/timezone in
> > the Android device.
> > I'm running the code below, using the built in getJulianDay function,
> > but it appears theJuliandate being calculated (var JD) is not
> > correct.
>
> > I'm getting values ~2440255 when I should be getting a value closer to
> > 2455082
>
> > TimeZone tz = TimeZone.getDefault();
> > int JD = Time.getJulianDay((new Time()).toMillis(false),
> > tz.getRawOffset());
>
> > Any help is appreciated
>
> I'd start by confirming that you're getting the right time in the first
> place, before theJulianconversion.
>
> If you are, and it is just theJulianconversion at issue, you might
> want to check over on Apache Harmony's lists and see if there are any
> outstanding issues. Time.getJulianDay() probably was not modified in
> Android and is just the Harmony implementation.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> _The Busy Coders' Guide to *Advanced* Android Development_ In Print!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to