wirebox.system.async.time

Class ChronoUnit

lucee.Component
    extended by wirebox.system.async.time.ChronoUnit

We represent a chrono unit class that assists with time units on date/time conversions It doesn't hold any date/time information.

Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • see : https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/ZoneOffset.html
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Method Summary
    Duration duration()
         Build out a new Duration class.
    any getSystemTimezone()
         This queries TimeZone.
    any getTimezone(any timezone)
         Get the Java Zone ID of the passed in timezone identifier string.
    Period period()
         Build out a new Period class.
    any toInstant(any target)
         Convert any ColdFusion date/time or string date/time object to a Java instant temporal object.
    any toJavaDate(any target)
         Convert any date/time or string date/time object to a Java Date/Time.
    any toLocalDate(any target, [any timezone])
         Convert any ColdFUsion date/time or string date/time object to the new Java.
    any toLocalDateTime(any target, [any timezone])
         Convert any ColdFUsion date/time or string date/time object to the new Java.
     
    Methods inherited from class lucee.Component
    None

    Method Detail

    duration

    public Duration duration()

    Build out a new Duration class


    getSystemTimezone

    public any getSystemTimezone()

    This queries TimeZone.getDefault() to find the default time-zone and converts it to a ZoneId. If the system default time-zone is changed, then the result of this method will also change.

    Returns:
    Java Timezone java.time.ZoneId

    getTimezone

    public any getTimezone(any timezone)

    Get the Java Zone ID of the passed in timezone identifier string

    Parameters:
    timezone - The String timezone identifier
    Returns:
    Java Timezone java.time.ZoneId
    Throws:
    ZoneRulesException - if the zone ID is a region ID that cannot be found

    period

    public Period period()

    Build out a new Period class


    toInstant

    public any toInstant(any target)

    Convert any ColdFusion date/time or string date/time object to a Java instant temporal object

    Parameters:
    target - The date/time or string object representing the date/time
    Returns:
    A Java temporal object as java.time.Instant

    toJavaDate

    public any toJavaDate(any target)

    Convert any date/time or string date/time object to a Java Date/Time

    Parameters:
    target - The date/time or string object representing the date/time
    Returns:
    A java date time object

    toLocalDate

    public any toLocalDate(any target, [any timezone])

    Convert any ColdFUsion date/time or string date/time object to the new Java.time.LocalDate class so we can use them as Temporal objects

    Parameters:
    target - The cf date/time or string object representing the date/time
    timezone - If passed, we will use this timezone to build the temporal object. Else we default to UTC
    Returns:
    A Java temporal object as java.time.LocalDate
    Throws:
    ZoneRulesException - if the zone ID is a region ID that cannot be found

    toLocalDateTime

    public any toLocalDateTime(any target, [any timezone])

    Convert any ColdFUsion date/time or string date/time object to the new Java.time.LocalDateTime class so we can use them as Temporal objects

    Parameters:
    target - The cf date/time or string object representing the date/time
    timezone - If passed, we will use this timezone to build the temporal object. Else we default to UTC
    Returns:
    A Java temporal object as java.time.LocalDateTime
    Throws:
    ZoneRulesException - if the zone ID is a region ID that cannot be found