我是android新手,我有使用Time对象需要使用的代码.有人可以在不使用Time类的情况下帮助我实现相同的功能.
Time dayTime = new Time();
dayTime.setToNow();
// we start at the day returned by local time. Otherwise this is a mess.
int julianStartDay = Time.getJulianDay(System.currentTimeMillis(), dayTime.gmtoff);
// now we work exclusively in UTC
dayTime = new Time();
long dateTime;
// Cheating to convert this to UTC time, which is what we want anyhow
// this code below is in a for loop
dateTime = dayTime.setJulianDay(julianStartDay + i);
day = getReadableDateString(dateTime);
Run Code Online (Sandbox Code Playgroud) android ×1