Represents times using the user's time zone.

Example

const userTimeObj = userTime;

Hierarchy

  • UserTime

Constructors

Methods

  • A [[Java.Time.Clock]] providing access to the current instant, date, and time using the user's time-zone.

    Returns Clock

    Example

    const userClock = userTime.clock();
    
  • A [[Java.Time.LocalDate]] date-time object that represents a date using the user's time-zone.

    Returns LocalDate

    Example

    const localDate = userTime.localDate();
    
  • A [[Java.Time.LocalDateTime]] date-time object that represents a date-time using the user's time-zone. Represented to nanosecond precision.

    Returns LocalDateTime

    Example

    const localDateTime = userTime.localDateTime();
    
  • A [[Java.Time.LocalTime]] date-time object that represents a time, often viewed as hour-minute-second. Time is represented to nanosecond precision.

    Returns LocalTime

    Example

    const localTime = userTime.localTime();
    
  • A current date-time from the system clock in the default time-zone.

    Returns ZonedDateTime

    Example

    const nowZoneDateTime = userTime.now();
    const nowHour = nowZoneDateTime.getHour();
  • A [[Java.Time.OffsetDateTime]] which is a [[Java.Time.Instant]] plus an offset from UTC/Greenwich, which allows the local date-time to be obtained. ZonedDateTime adds full time-zone rules.

    Returns OffsetDateTime

    Example

    const offsetDateTime = userTime.offsetDateTime();
    
  • A time with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as 10:15:30+01:00.

    Returns OffsetTime

    Example

    const offsetTime = userTime.offsetTime();
    
  • The current year in the ISO-8601 calendar system, such as 2019.

    Returns Year

    Example

    const curYear = userTime.year();
    
  • The current year and month in the ISO-8601 calendar system, such as 2007-12.

    Returns YearMonth

    Example

    const yearMonth = userTime.yearMonth();
    
  • Returns the [[Java.Time.ZoneId]] that represents the users time zone.

    Returns ZoneId

    Example

    const timeZoneId = userTime.zoneId();
    

Generated using TypeDoc