Android time management -
i working 1 database record on android. has 1 column storing number , column storing time in millisecond. there should 1 record. however, record should refreshed @ 6:00am next day. means when want update number, supposed check if time beyond refreshing time. there simple way achieve checking? not sure if have explained problem clearly. explain in way, want check if there 1 "6 am" between 2 time stored in millisecond. lot!
public static boolean needrefreshbean(long milli){ calendar cal = calendar.getinstance(); cal.settimeinmillis(milli); if(cal.get(calendar.hour_of_day)>resettime) cal.add(calendar.day_of_year,1); cal.set(calendar.hour_of_day,resettime); //cal represents supposed refresh time if(cal.gettimeinmillis()<system.currenttimemillis()){ return true; } else return false; }
i write function this. input updated time stored in database. not sure if works
Comments
Post a Comment