Converts las adjusted standard gps time to {@link DateTime}.

@param adjustedStandardGpsTime the time value.
@return the UTC date object.
429228
public static DateTime adjustedStandardGpsTime2DateTime( double adjustedStandardGpsTime ) {
        // gps time is adjusted gps time
        double standardGpsTimeSeconds = adjustedStandardGpsTime + 1E9;
        double standardGpsTimeMillis = standardGpsTimeSeconds * 1000;
        DateTime dt1 = gpsEpoch.plus((long) standardGpsTimeMillis);
        return dt1;
    }
194205
def int_gps_time_to_str(t):
    """"""

    if isinstance(t, int):
        return str(t)
    elif isinstance(t, float):
        # Wouldn't this just work generically?
        int_t = int(t)
        if abs(t - int_t) > 0.:
            raise ValueError('Need an integer GPS time, got %s' % str(t))
        return str(int_t)
    elif isinstance(t, lal.LIGOTimeGPS):
        if t.gpsNanoSeconds == 0:
            return str(t.gpsSeconds)
        else:
            raise ValueError('Need an integer GPS time, got %s' % str(t))
    else:
        err_msg = "Didn't understand input type {}".format(type(t))
        raise ValueError(err_msg)
852381
@Override
	public LocalDate getAdjustedDate(LocalDate date, DateRollConvention dateRollConvention) {
		if(dateRollConvention == DateRollConvention.UNADJUSTED) {
			return date;
		}
		else if(dateRollConvention == DateRollConvention.MODIFIED_FOLLOWING) {
			LocalDate adjustedDate = getAdjustedDate(date, DateRollConvention.FOLLOWING);
			if (adjustedDate.getMonth() != date.getMonth()){
				return getAdjustedDate(date, DateRollConvention.PRECEDING);
			} else {
				return adjustedDate;
			}
		}
		else if(dateRollConvention == DateRollConvention.MODIFIED_PRECEDING) {
			LocalDate adjustedDate = getAdjustedDate(date, DateRollConvention.PRECEDING);
			if (adjustedDate.getMonth() != date.getMonth()) {
				return getAdjustedDate(date, DateRollConvention.FOLLOWING);
			} else {
				return adjustedDate;
			}
		}
		else if(dateRollConvention == DateRollConvention.FOLLOWING || dateRollConvention == DateRollConvention.PRECEDING) {
			int adjustment = dateRollConvention == DateRollConvention.FOLLOWING ? 1 : -1;
			LocalDate adjustedDate = date;
			while(!isBusinessday(adjustedDate)) {
				adjustedDate = adjustedDate.plusDays(adjustment);
			}
			return adjustedDate;
		}

		throw new IllegalArgumentException("Unknown date roll convention.");
	}
1287352
def utcfromtimestamp(cls, t):
        ""
        t, frac = divmod(t, 1.0)
        us = int(frac * 1e6)

        # If timestamp is less than one microsecond smaller than a
        # full second, us can be rounded up to 1000000.  In this case,
        # roll over to seconds, otherwise, ValueError is raised
        # by the constructor.
        if us == 1000000:
            t += 1
            us = 0
        y, m, d, hh, mm, ss, weekday, jday, dst = _time.gmtime(t)
        ss = min(ss, 59)    # clamp out leap seconds if the platform has them
        return cls(y, m, d, hh, mm, ss, us)
1008206
@Override
    public ChronoZonedDateTime<D> with(TemporalAdjuster adjuster) {
        return toLocalDate().getChronology().ensureChronoZonedDateTime(super.with(adjuster));
    }
585256
protected TimeZone resolveDefaultTimeZone(Translet translet) {
        TimeZone defaultTimeZone = getDefaultTimeZone();
        if (defaultTimeZone != null) {
            translet.getRequestAdapter().setTimeZone(defaultTimeZone);
            return defaultTimeZone;
        } else {
            return translet.getRequestAdapter().getTimeZone();
        }
    }
616796
public ClockSkewAdjustment getAdjustment(AdjustmentRequest adjustmentRequest) {
        ValidationUtils.assertNotNull(adjustmentRequest, "adjustmentRequest");
        ValidationUtils.assertNotNull(adjustmentRequest.exception, "adjustmentRequest.exception");
        ValidationUtils.assertNotNull(adjustmentRequest.clientRequest, "adjustmentRequest.clientRequest");
        ValidationUtils.assertNotNull(adjustmentRequest.serviceResponse, "adjustmentRequest.serviceResponse");

        int timeSkewInSeconds = 0;
        boolean isAdjustmentRecommended = false;

        try {
            if (isAdjustmentRecommended(adjustmentRequest)) {
                Date serverDate = getServerDate(adjustmentRequest);

                if (serverDate != null) {
                    timeSkewInSeconds = timeSkewInSeconds(getCurrentDate(adjustmentRequest), serverDate);
                    isAdjustmentRecommended = true;
                }
            }
        } catch (RuntimeException e) {
            log.warn("Unable to correct for clock skew.", e);
        }

        return new ClockSkewAdjustment(isAdjustmentRecommended, timeSkewInSeconds);
    }
865122
protected function adjustedStartTime($iTime = null)
    {
        $strSql = $iTime
            ? 'sked_events.starts_at - INTERVAL DAYOFWEEK(sked_events.starts_at) DAY + INTERVAL '
                . (date('w', $iTime) + 1) . ' DAY'
            : 'sked_events.starts_at';

        if ($this->bAdjustForLeadTime)
            $strSql = 'DATE_SUB(' . $strSql . ', INTERVAL sked_event_members.lead_time MINUTE)';

        return $strSql;
    }
1241084
@Nullable
    public Date getGpsDate()
    {
        String date = getString(TAG_DATE_STAMP);
        Rational[] timeComponents = getRationalArray(TAG_TIME_STAMP);

        // Make sure we have the required values
        if (date == null)
            return null;
        if (timeComponents == null || timeComponents.length != 3)
            return null;

        String dateTime = String.format(Locale.US, "%s %02d:%02d:%02.3f UTC",
            date, timeComponents[0].intValue(), timeComponents[1].intValue(), timeComponents[2].doubleValue());
        try {
            DateFormat parser = new SimpleDateFormat("yyyy:MM:dd HH:mm:ss.S z");
            return parser.parse(dateTime);
        } catch (ParseException e) {
            return null;
        }
    }
1258374
public static OffsetDateTime toOffsetDateTime(final Calendar self) {
        return OffsetDateTime.of(toLocalDateTime(self), getZoneOffset(self));
    }
555030
private static boolean isunixtimeleap( double unixTime ) {
        double gpsTime = unixTime - 315964800;
        gpsTime += countleaps(gpsTime, true) - 1;

        return isleap(gpsTime);
    }
554840
@ManagedAttribute(
         description = "Number of seconds since cache started",
         displayName = "Seconds since cache started",
         units = Units.SECONDS,
         measurementType = MeasurementType.TRENDSUP,
         displayType = DisplayType.SUMMARY
   )
   @Deprecated
   public long getElapsedTime() {
      // backward compatibility as we renamed ElapsedTime to TimeSinceStart
      return getTimeSinceStart();
   }
251800
@Override
	public double getPaymentOffset(double fixingTime) {
		LocalDate fixingDate		= getDateFromModelTime(fixingTime);
		LocalDate paymentDate		= paymentBusinessdayCalendar.getAdjustedDate(fixingDate, paymentOffsetCode, paymentDateRollConvention);
		double paymentTime = FloatingpointDate.getFloatingPointDateFromDate(getReferenceDate(), paymentDate);
		return paymentTime-fixingTime;
	}
933486
@SuppressWarnings("deprecation")
    private static Time shiftDST(LocalTime lt) {
        Time t = Time.valueOf(lt);
        int offset = Calendar.getInstance().get(Calendar.DST_OFFSET) / 1000;
        // I know this are deprecated methods, but it's so much clearer than alternatives
        int m = t.getSeconds();
        t.setSeconds(m + offset);
        return t;
    }
39990
public static String changeFormatAndTimeZone(String isoTimestamp,
            String toBeTimeFormat) {
        return changeFormatAndTimeZone(isoTimestamp, toBeTimeFormat,
                DEFAULT_ZONE_ID);
    }
772392
@Override public void updateTime(final ZonedDateTime TIME) {
        if (dateText.isVisible()) {
            dateText.setText(dateTextFormatter.format(TIME));
            Helper.adjustTextSize(dateText, 0.6 * size, size * 0.08);
            dateText.relocate((size - dateText.getLayoutBounds().getWidth()) * 0.5, size * 0.22180451);
        }
        if (dateNumbers.isVisible()) {
            dateNumbers.setText(dateNumberFormatter.format(TIME));
            Helper.adjustTextSize(dateNumbers, 0.6 * size, size * 0.08);
            dateNumbers.relocate((size -dateNumbers.getLayoutBounds().getWidth()) * 0.5, size * 0.68984962);
        }

        hour.setText(HOUR_FORMATTER.format(TIME));
        Helper.adjustTextSize(hour, 0.4 * size, 0.328 * size);
        hour.relocate(0.136 * size, (size - hour.getLayoutBounds().getHeight()) * 0.5);

        minute.setText(MINUTE_FORMATTER.format(TIME));
        Helper.adjustTextSize(minute, 0.4 * size, 0.328 * size);
        minute.relocate(0.544 * size, (size - minute.getLayoutBounds().getHeight()) * 0.5);

        if (secondBackgroundCircle.isVisible()) {
            secondArc.setLength((-6 * TIME.getSecond()));
            if (clock.isDiscreteSeconds()) {
                secondArc.setLength((-6 * TIME.getSecond()));
            } else {
                secondArc.setLength((-6 * TIME.getSecond() -TIME.get(ChronoField.MILLI_OF_SECOND) * 0.006));
            }
        }
    }
453429
public static String getDateAsString(final double JULIAN_DAY, final int TIMEZONE_OFFSET) throws Exception {
        if (JULIAN_DAY == -1) return "NO RISE/SET/TRANSIT FOR THIS OBSERVER/DATE";

        int date[] = SunMoonCalculator.getDate(JULIAN_DAY);
        return date[0] + "/" + date[1] + "/" + date[2] + " " + ((date[3] + TIMEZONE_OFFSET) % 24) + ":" + date[4] + ":" + date[5] + " UT";
    }