Android Question Unix Date to Android?

Dave Mosher

New Member
Licensed User
Longtime User
I have a long variable ExpDate (1513728000) that contains a valid Unix date/time (12/20/2017 00:00:00). When I process it thru the statement-

Log(DateTime.date(DateUtils.UnixTimeToTicks(ExpDate))& " " & DateTime.time(DateUtils.UnixTimeToTicks(ExpDate)))

I get a return string of

12/19/2017 19:00:00

Any ideas as to why? I'm new to the Android platform and B4A. but have been coding in multiple platforms including Windows, Unix, Solaris, OS400 and in various languages including Forth, C, C++, VB and more...This project is a mobile app sharing information common to all the above platforms and this is the only one that incorrectly computes this date/time from the above unix timestamp???
 

Dave Mosher

New Member
Licensed User
Longtime User
Bingo! The .Settimezone was the key...I hadn't given that a thought as I was working with an existing timestamp and not a "now". I guess b4a factors it in in this case...Thank you!
 
Upvote 0
Top