Haha Thanks Mark, I made the same mistake, which makes sense now. Guess we were both a bit careless. Also, I wish that they would of had the line 'the time is initialized to Jan 1, 1970' in the initial constructer definition. Only way to see that is if you click the hyperlink and jump down to the definition further down the page.
I think I got it working now for the most part. I'm sure others will have the same question, so for the record the code below works. I need to mess a bit with it configuring it to the users timezone, but people should get the jist of it. int JD = Time.getJulianDay((new Date()).getTime(), 0); On Sep 8, 2:17 pm, Mark Murphy <[email protected]> wrote: > Feras wrote: > > 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? > > Whoops, and I screwed up -- I was thinking Date instead of Time, and > Time is an Android-ism, not a Harmony class. > > According to the docs, new Time() does: > > "Construct a Time object in the default timezone. The time is > initialized to Jan 1, 1970. " > > So, it is behaving as documented. > > You will need to use other static methods or set() or something to fill > in the date. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > _Android Programming Tutorials_ Version 1.0 Available! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

