Bluestep JS Documentation
    Preparing search index...

    Class Time

    This is an implementation of Java Time. See the docs for java.time (SE 11). If you don't like java.time, feel free to import a JavaScript library to use.

    Ways to get the current time:

    B.optUser.ifPresent(user => user.time.now());
    B.time.Instant().now();
    B.time.Clock().system().now();
    Index

    Constructors

    Properties

    B6P_LOCAL_DATE: DateTimeFormatter

    Convenience property. Same as calling B.time.DateTimeFormatter.ofPattern("uuuu/MM/dd")

    B6P_LOCAL_DATETIME: DateTimeFormatter

    Convenience property. Same as calling B.time.DateTimeFormatter.ofPattern("uuuu/MM/dd hh:mm:ss a")

    B6P_LOCAL_TIME: DateTimeFormatter

    Convenience property. Same as calling B.time.DateTimeFormatter.ofPattern("hh:mm:ss a")

    Calendar: typeof Calendar

    This is deprecated and should only be used when required.

    ChronoUnit: typeof ChronoUnit
    Clock: typeof Clock

    Java doc: java.time.Clock

    DateTimeFormatter: typeof DateTimeFormatter
    DateTimeFormatterBuilder: typeof DateTimeFormatterBuilder
    DayOfWeek: typeof DayOfWeek
    Duration: typeof Duration
    Instant: typeof Instant
    LocalDate: typeof LocalDate
    LocalDateTime: typeof LocalDateTime
    LocalTime: typeof LocalTime
    Month: typeof Month

    Java doc: java.time.Month

    MonthDay: typeof MonthDay
    OffsetDateTime: typeof OffsetDateTime
    OffsetTime: typeof OffsetTime
    Period: typeof Period

    Java doc: java.time.Period

    TemporalAdjusters: typeof TemporalAdjusters
    TimeZone: typeof TimeZone

    This is deprecated and should only be used when required.

    ValueRange: typeof ValueRange
    Year: typeof Year

    Java doc: java.time.Year

    YearMonth: typeof YearMonth
    ZonedDateTime: typeof ZonedDateTime
    ZoneId: typeof ZoneId

    Java doc: java.time.ZoneId

    ZoneOffset: typeof ZoneOffset

    Methods

    • Creates a new [[Java.Time.Date]]

      Parameters

      • Optionaltime: number

        epoc milliseconds

      Returns Date

    • Creates a [[Java.Time.Date]] object given an [[Java.Time.Instant]]

      Parameters

      Returns Date

    • Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.

      Returns number

    • Returns the current value of the running Java Virtual Machine's high-resolution time source, in nanoseconds. This method can only be used to measure elapsed time and is not related to any other notion of system or wall-clock time. The value returned represents nanoseconds since some fixed but arbitrary origin time (perhaps in the future, so values may be negative). The same origin is used by all invocations of this method in an instance of a Java virtual machine; other virtual machine instances are likely to use a different origin. This method provides nanosecond precision, but not necessarily nanosecond resolution (that is, how frequently the value changes) - no guarantees are made except that the resolution is at least as good as that of currentTimeMillis(). Differences in successive calls that span greater than approximately 292 years (263 nanoseconds) will not correctly compute elapsed time due to numerical overflow. The values returned by this method become meaningful only when the difference between two such values, obtained within the same instance of a Java virtual machine, is computed. For example, to measure how long some code takes to execute: long startTime = B.time.nanos(); // ... the code being measured ... long elapsedNanos = B.time.nanos() - startTime; To compare elapsed time against a timeout, use if (B.time.nanos() - startTime >= timeoutNanos) ... instead of if (B.time.nanos() >= startTime + timeoutNanos) ... because of the possibility of numerical overflow.

      Returns number

    • Return the user's ZoneId or the Systems ZoneId if there is no user.

      Returns ZoneId