posted 22 years ago
Oops, false alarm - I saw that there were warnings, and without looking further I assumed that the deprecated methods were the source of your trouble. Turns out that's not really the case. You should still avoid deprecated methods though. If we follow the instructions:
Note: Recompile with -deprecation for details
That means compile like this:
(plus any other compiler flags you wish to use). This gives you additional information:
Basically this tells us exactly which methods are considered incorrect to use. Typically you can look in the API for these methods, but in this case there's not a lot of information there. The short answer is, don't use these methods; they'll confuse us. Use toString(), or use a DateFormat object instead.
Anyway, that's probably just a distraction I think from your original question. You originally said:
i new an instance of Data clase, and pass for it a long number. when i print it, it print : "January 1, 1970, 00:00:00 GMT"
Now in your last code shown, that's no longer true - you are getting a different time, Mon Jan 12 05:12:01 GMT+07:00 1970. (Also expressed in several other formats; all equivalent.) Looks like a perfectly good result to me. So, does this mean that your original question has been answered to your satisfaction? Were you expecting some other result?
"I'm not back." - Bill Harding, Twister