0
Timeクラスは非推奨であるため、次の関数ではgetJulianDay()を使用できなくなりました。私はそれを達成するためにCalenderまたはGregorianCalenderクラスを使いたい。私は[質問]から私の答えを部分的に得ました:Time getJulianDay() deprecated which alternatives to convert date to julian and vice versa? 私はそのようなクラスには新しく、GregorianCalenderをどのようにして長時間変換して関数に戻すことができないのか分かりません。ユリウス暦の日付を取得するにはどうすればいいですか?ありがとう!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);
}
ユリウス暦の日付について[多くの質問と回答があります(/検索?q =%5Bjava%5D +ジュリアン+日付)です。彼らはどうしたらいいですか?たとえば、[this one](http://stackoverflow.com/questions/20035403/julian-date-to- regular-date-conversion)? –