I've been trying to find the answer to this for a while today and there's just so much contradictory information....
What I'd like to do is get a current unix timestamp in android, and then convert it to a format that allows me to getHours() and getMinutes().
I'm currently doing this:
int time = (int) (System.currentTimeMillis());
Timestamp ts = new Timestamp(time);
mHour = ts.getHours();
mMinute = ts.getMinutes();
But it's not giving me a correct value for hour or minute (it's returning 03:38 for the current East-coast time of 13:33).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…