0
我想使用GregorianCalendar而不是Time類,android文檔如何顯示,但如何管理julian日期作爲int在我的sqlLite數據庫中存儲日期?Time getJulianDay()已棄用將日期轉換爲朱利安的替代方法,反之亦然?
我該如何轉換此代碼?
public static long normalizeDate(long startDate) {
// normalize the start date to the beginning of the (UTC) day
Time time = new Time();
time.set(startDate);
int julianDay = Time.getJulianDay(startDate, time.gmtoff);
return time.setJulianDay(julianDay);
}
而當我查詢一行怎麼能得到正常的日期由朱連日?
謝謝安德烈但我需要的是不考慮時區 –
@FedericoPonti我已經更新了我的答案的解決方案,它現在應該做你所需要的。 –
非常感謝Andrea! –