Converts this time to epoch nanos based on 1970-01-01Z.

@return the epoch nanos value
194441
private long toEpochNano() {
        long nod = time.toNanoOfDay();
        long offsetNanos = offset.getTotalSeconds() * NANOS_PER_SECOND;
        return nod - offsetNanos;
    }
471901
public Long getUnixTimeMillis() {
        String time = tags.get("c");
        if (time == null)
            return null;
        else
            try {
                return Long.parseLong(time) * 1000;
            } catch (NumberFormatException e) {
                return null;
            }
    }
1020073
static Moment readTimestamp(
        DataInput in,
        boolean positiveLS,
        boolean hasNanos
    ) throws IOException {

        long unixTime = in.readLong();
        int nano = (hasNanos ? in.readInt() : 0);

        if (unixTime == 0) {
            if (positiveLS) {
                throw new InvalidObjectException(
                    "UTC epoch is no leap second.");
            } else if (nano == 0) {
                return UNIX_EPOCH;
            }
        }

        if (
            (unixTime == MIN_LIMIT)
            && (nano == 0)
        ) {
            if (positiveLS) {
                throw new InvalidObjectException("Minimum is no leap second.");
            }
            return MIN;
        } else if (
            (unixTime == MAX_LIMIT)
            && (nano == MRD - 1)
        ) {
            if (positiveLS) {
                throw new InvalidObjectException("Maximum is no leap second.");
            }
            return MAX;
        } else {
            checkFraction(nano);
        }

        if (positiveLS) {
            LeapSeconds ls = LeapSeconds.getInstance();
            if (
                !ls.isEnabled() // keep LS-state when propagating to next vm
                || ls.isPositiveLS(ls.enhance(unixTime) + 1)
            ) {
                nano |= POSITIVE_LEAP_MASK;
            } else {
                long packed = GregorianMath.toPackedDate(unixTime);
                int month = GregorianMath.readMonth(packed);
                int day = GregorianMath.readDayOfMonth(packed);
                throw new InvalidObjectException(
                    "Not registered as leap second event: "
                    + GregorianMath.readYear(packed)
                    + "-"
                    + ((month < 10) ? "0" : "")
                    + month
                    + ((day < 10) ? "0" : "")
                    + day
                    + " [Please check leap second configurations "
                    + "either of emitter vm or this target vm]"
                );
            }
        }

        return new Moment(nano, unixTime);

    }
67393
@Override
	public Date readDate() {
		/*
		 * Date: 0x0B T7 T6 .. T0 Z1 Z2 T7 to T0 form a 64 bit Big Endian number
		 * that specifies the number of nanoseconds that have passed since
		 * 1/1/1970 0:00 to the specified time. This format is UTC 1970. Z1 an
		 * Z0 for a 16 bit Big Endian number indicating the indicated time's
		 * timezone in minutes.
		 */
		long ms = (long) buf.getDouble();
		// The timezone can be ignored as the date always is encoded in UTC
		@SuppressWarnings("unused")
		short timeZoneMins = buf.getShort();
		Date date = new Date(ms);
		storeReference(date);
		return date;
	}
1329461
public long getReveseDNSCacheLifetime()
            throws NumberFormatException {

        long value = 60*60*1000;

        String property = getProperty(REVERSE_DNS_CACHE_LIFETIME);
        if (property != null && property.length() > 0) {
            long parsedValue = Long.parseLong(property);
            if (parsedValue > 0) {
                value = parsedValue;
            }
        }

        // System property takes precedence
        property = System.getProperty(REVERSE_DNS_CACHE_LIFETIME);
        if (property != null && property.length() > 0) {
            long parsedValue = Long.parseLong(property);
            if (parsedValue > 0) {
                value = parsedValue;
            }
        }

        return value;
    }
309703
public function toDecimal() : string
    {
        $result = (string) $this->epochSecond;

        if ($this->nano !== 0) {
            $nano = (string) $this->nano;
            $nano = str_pad($nano, 9, '0', STR_PAD_LEFT);
            $nano = rtrim($nano, '0');

            $result .= '.' . $nano;
        }

        return $result;
    }
1048063
public PlainTimestamp now() {

        final UnixTime ut = this.timeSource.currentTime();
        Timezone tz = (this.timezone == null) ? Timezone.ofSystem() : this.timezone;
        return PlainTimestamp.from(ut, tz.getOffset(ut));

    }
617996
public com.google.protobuf.TimestampOrBuilder getTimestampValueOrBuilder() {
    if (typeCase_ == 5) {
      return (com.google.protobuf.Timestamp) type_;
    }
    return com.google.protobuf.Timestamp.getDefaultInstance();
  }
1084858
public long getTimeRemainingInMillis()
    {
        long batchTime = System.currentTimeMillis() - startTime;
        double timePerIteration = (double) batchTime / (double) worked.get();
        return (long) (timePerIteration * (total - worked.get()));
    }
444434
public long currentTimeInMillis() {

        if (this.monotonic || MONOTON_MODE) {
            long nanos = this.utcNanos();
            long secs = LeapSeconds.getInstance().strip(Math.floorDiv(nanos, MRD));
            return Math.multiplyExact(secs, 1000) + Math.floorMod(nanos, MIO);
        } else {
            return System.currentTimeMillis();
        }

    }
1229397
public long getEstimatedRemainingTimeMillis() {
        long d = executableEstimatedDuration;
        if (d < 0) {
            return DEFAULT_ESTIMATED_DURATION;
        }

        long eta = d - getElapsedTime();
        if (eta <= 0) {
            return DEFAULT_ESTIMATED_DURATION;
        }

        return eta;
    }
1215219
public static Date parseEpochTimestamp(String value)
   {
      Date result = null;

      if (value.length() > 0)
      {
         if (!value.equals("-1 -1"))
         {
            Calendar cal = DateHelper.popCalendar(JAVA_EPOCH);

            int index = value.indexOf(' ');
            if (index == -1)
            {
               if (value.length() < 6)
               {
                  value = "000000" + value;
                  value = value.substring(value.length() - 6);
               }

               int hours = Integer.parseInt(value.substring(0, 2));
               int minutes = Integer.parseInt(value.substring(2, 4));
               int seconds = Integer.parseInt(value.substring(4));

               cal.set(Calendar.HOUR, hours);
               cal.set(Calendar.MINUTE, minutes);
               cal.set(Calendar.SECOND, seconds);
            }
            else
            {
               long astaDays = Long.parseLong(value.substring(0, index));
               int astaSeconds = Integer.parseInt(value.substring(index + 1));

               cal.add(Calendar.DAY_OF_YEAR, (int) (astaDays - ASTA_EPOCH));
               cal.set(Calendar.MILLISECOND, 0);
               cal.set(Calendar.SECOND, 0);
               cal.set(Calendar.HOUR, 0);
               cal.add(Calendar.SECOND, astaSeconds);
            }

            result = cal.getTime();
            DateHelper.pushCalendar(cal);
         }
      }

      return result;
   }
1343392
public Date getAccessedDateTime() {

		long time = 0;

		if (atime != null) {
			time = atime.longValue() * 1000;
		}

		if (atime != null) {
			time += (atime_nano.longValue() / 1000000);
		}
		return new Date(time);
	}
789355
def timestamp_pb(self):
        
        inst = self if self.tzinfo is not None else self.replace(tzinfo=pytz.UTC)
        delta = inst - _UTC_EPOCH
        seconds = int(delta.total_seconds())
        nanos = self._nanosecond or self.microsecond * 1000
        return timestamp_pb2.Timestamp(seconds=seconds, nanos=nanos)
345188
public static Timestamp of(Date date) {
        if (date == null)
            return null;
        long time = date.getTime();
        int nanoSec = (int) (time % 1000) * 1000000;
        long epochSec = (time / 1000);
        return createWithCarry(epochSec, nanoSec);
    }
539734
public int getYear()
    {
        Timestamp adjusted = this;

        if (this._offset != null) {
            if (this._offset.intValue() != 0) {
                adjusted = make_localtime();
            }
        }
        return adjusted._year;
    }
1064944
@Override
    public long toEpochDay() {
        long epochDay = ((long) this.prolepticYear) * DAYS_IN_YEAR +
                InternationalFixedChronology.getLeapYearsBefore(this.prolepticYear) + this.dayOfYear;
        return epochDay - DAYS_0000_TO_1970;
    }