long setYear(long instant, int year) { // optimsed implementation of set, due to fixed months int thisYear = getYear(instant); int dayOfYear = getDayOfYear(instant, thisYear); int millisOfDay = getMillisOfDay(instant); // Current year is leap, and day is leap. if (dayOfYear > 354 && !isLeapYear(year)) { // Moving to a non-leap year, leap day doesn't exist. dayOfYear--; } instant = getYearMonthDayMillis(year, 1, dayOfYear); instant += millisOfDay; return instant; }
long setYear(long instant, int year) { // optimsed implementation of set, due to fixed months int thisYear = getYear(instant); int dayOfYear = getDayOfYear(instant, thisYear); int millisOfDay = getMillisOfDay(instant); // Current year is leap, and day is leap. if (dayOfYear > 354 && !isLeapYear(year)) { // Moving to a non-leap year, leap day doesn't exist. dayOfYear--; } instant = getYearMonthDayMillis(year, 1, dayOfYear); instant += millisOfDay; return instant; }
long setYear(long instant, int year) { // optimsed implementation of set, due to fixed months int thisYear = getYear(instant); int dayOfYear = getDayOfYear(instant, thisYear); int millisOfDay = getMillisOfDay(instant); if (dayOfYear > 354) { // Current year is leap, and day is leap. if (!isLeapYear(year)) { // Moving to a non-leap year, leap day doesn't exist. dayOfYear--; } } instant = getYearMonthDayMillis(year, 1, dayOfYear); instant += millisOfDay; return instant; }
long setYear(long instant, int year) { // optimsed implementation of set, due to fixed months int thisYear = getYear(instant); int dayOfYear = getDayOfYear(instant, thisYear); int millisOfDay = getMillisOfDay(instant); // Current year is leap, and day is leap. if (dayOfYear > 354 && !isLeapYear(year)) { // Moving to a non-leap year, leap day doesn't exist. dayOfYear--; } instant = getYearMonthDayMillis(year, 1, dayOfYear); instant += millisOfDay; return instant; }
long setYear(long instant, int year) { // optimsed implementation of set, due to fixed months int thisYear = getYear(instant); int dayOfYear = getDayOfYear(instant, thisYear); int millisOfDay = getMillisOfDay(instant); if (dayOfYear > 354) { // Current year is leap, and day is leap. if (!isLeapYear(year)) { // Moving to a non-leap year, leap day doesn't exist. dayOfYear--; } } instant = getYearMonthDayMillis(year, 1, dayOfYear); instant += millisOfDay; return instant; }
long setYear(long instant, int year) { // optimsed implementation of set, due to fixed months int thisYear = getYear(instant); int dayOfYear = getDayOfYear(instant, thisYear); int millisOfDay = getMillisOfDay(instant); if (dayOfYear > 354) { // Current year is leap, and day is leap. if (!isLeapYear(year)) { // Moving to a non-leap year, leap day doesn't exist. dayOfYear--; } } instant = getYearMonthDayMillis(year, 1, dayOfYear); instant += millisOfDay; return instant; }
long setYear(long instant, int year) { // optimsed implementation of set, due to fixed months int thisYear = getYear(instant); int dayOfYear = getDayOfYear(instant, thisYear); int millisOfDay = getMillisOfDay(instant); if (dayOfYear > 354) { // Current year is leap, and day is leap. if (!isLeapYear(year)) { // Moving to a non-leap year, leap day doesn't exist. dayOfYear--; } } instant = getYearMonthDayMillis(year, 1, dayOfYear); instant += millisOfDay; return instant; }
long setYear(long instant, int year) { // optimsed implementation of set, due to fixed months int thisYear = getYear(instant); int dayOfYear = getDayOfYear(instant, thisYear); int millisOfDay = getMillisOfDay(instant); if (dayOfYear > 354) { // Current year is leap, and day is leap. if (!isLeapYear(year)) { // Moving to a non-leap year, leap day doesn't exist. dayOfYear--; } } instant = getYearMonthDayMillis(year, 1, dayOfYear); instant += millisOfDay; return instant; }
long setYear(long instant, int year) { // optimsed implementation of set, due to fixed months int thisYear = getYear(instant); int dayOfYear = getDayOfYear(instant, thisYear); int millisOfDay = getMillisOfDay(instant); if (dayOfYear > 354) { // Current year is leap, and day is leap. if (!isLeapYear(year)) { // Moving to a non-leap year, leap day doesn't exist. dayOfYear--; } } instant = getYearMonthDayMillis(year, 1, dayOfYear); instant += millisOfDay; return instant; }
long setYear(long instant, int year) { // optimsed implementation of set, due to fixed months int thisYear = getYear(instant); int dayOfYear = getDayOfYear(instant, thisYear); int millisOfDay = getMillisOfDay(instant); if (dayOfYear > 354) { // Current year is leap, and day is leap. if (!isLeapYear(year)) { // Moving to a non-leap year, leap day doesn't exist. dayOfYear--; } } instant = getYearMonthDayMillis(year, 1, dayOfYear); instant += millisOfDay; return instant; }
long setYear(long instant, int year) { // optimsed implementation of set, due to fixed months int thisYear = getYear(instant); int dayOfYear = getDayOfYear(instant, thisYear); int millisOfDay = getMillisOfDay(instant); if (dayOfYear > 354) { // Current year is leap, and day is leap. if (!isLeapYear(year)) { // Moving to a non-leap year, leap day doesn't exist. dayOfYear--; } } instant = getYearMonthDayMillis(year, 1, dayOfYear); instant += millisOfDay; return instant; }