Class FlowableExpressionTimeUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if the first value is equal to the second value.Converts a value to a date.Converts a value to an Instant.Converts a value to an Instant in the given zone.protected Instant
asLocalDate
(Object value) Converts a value to a LocalDate.asLocalDate
(Object value, String zoneId) Converts a value to a LocalDate in the given zone.protected LocalDate
asLocalDate
(Object value, ZoneId zoneId) asLocalDateTime
(Object value) Converts a value to a LocalDateTime.asLocalDateTime
(Object value, String zoneId) Converts a value to a LocalDateTime in the given zone.protected LocalDateTime
asLocalDateTime
(Object value, ZoneId zoneId) Sets the time of the value to the specified hours, minutes and seconds.atTimeWithTimeZone
(Object value, int hours, int minutes, int seconds, String timezoneId) Sets the time of the value to the specified hours, minutes and seconds in the given timezone.atTimeZone
(Object dateOrInstant, String timeZoneId) Returns an instant at a specified time zone.Returns the current date at 00:00 AM UTC.dateFromTimestamp
(long timestamp) Returns a date from the number of seconds that have passed since the first of January 1970 (Unix Timestamp).long
daysBetween
(Object firstValue, Object secondValue) Get the number of days between two values.fullDateTimeDate
(int year, int month, int day, int hour, int minute, int second) Constructs anDate
based on a given year, month, day, hour, minute and second.fullDateTimeInstant
(int year, int month, int day, int hour, int minute, int second) Constructs anInstant
based on a given year, month, day, hour, minute and second.Receives a list of all available timeZoneIds maintained as specified by the IANA.protected long
getDurationBetween
(Object firstValue, Object secondValue, ChronoUnit chronoUnit) int
Obtains a "slice of time" by specifying aChronoField
asString
.long
getFieldFromDurationBetweenDates
(Object firstDateOrInstant, Object secondDateOrInstant, String chronoUnitString) Gets the duration between two values.long
getTimeZoneOffset
(Object value, String timeZoneId) Calculates the number of seconds a specific point in time at a specified time zone is set off from UTC.long
hoursBetween
(Object firstValue, Object secondValue) Get the number of hours between two values.instantFromTimestamp
(long timestamp) Returns an instant from the number of seconds that have passed since the first of January 1970 (Unix Timestamp).boolean
Checks if the first value is after the second value.boolean
isAfterOrEqual
(Object firstValue, Object secondValue) Checks if the first value is after or equal to the second value.boolean
isAfterTime
(Object value, String timeZoneId, int hours, int minutes, int seconds) Checks if the givenvalue
is after a certain time in a given time zone.boolean
Checks if the first value is before the second value.boolean
isBeforeOrEqual
(Object firstValue, Object secondValue) Checks if the first value is before or equals to the second value.boolean
isBeforeTime
(Object value, String timeZoneId, int hours, int minutes, int seconds) Checks if the givenvalue
is before a certain time in a given time zone.boolean
Determines whether the current day is a weekend.Subtracts days from the defined value.minusDuration
(Object value, String iso8601Duration) Subtracts an ISO8601-encoded duration to the value.minusHours
(Object value, long hours) Subtracts hours from the defined value.minusMinutes
(Object value, long minutes) Subtracts minutes from the defined value.minusMonths
(Object value, long months) Subtracts months from the defined value.minusSeconds
(Object value, long seconds) Subtracts seconds from the defined value.minusWeeks
(Object value, long weeks) Subtracts weeks from the defined value.minusYears
(Object value, long years) Subtracts years from the defined value.long
minutesBetween
(Object firstValue, Object secondValue) Get the number of minutes between two values.long
monthsBetween
(Object firstValue, Object secondValue) Get the number of months between two values.now()
Returns the current date and time in UTC.parseInstant
(Object value, String pattern) Parse the object in to an Instant Supported inputs are: String Json TextNodenull
parseInstant
(String instantIsoString) Parse an ISO 8601 String to Instant.parseLocalDate
(Object value, String pattern) Parse the object in to a LocalDate Supported inputs are: String Json TextNodenull
parseLocalDateTime
(Object value, String pattern) Parse the object in to a LocalDateTime Supported inputs are: String Json TextNodenull
Adds days to the defined value.plusDuration
(Object value, String iso8601Duration) Adds an ISO8601-encoded duration to the value.Adds hours to the defined value.plusMinutes
(Object value, long minutes) Adds minutes to the defined value.plusMonths
(Object value, long months) Adds months to the defined value.plusSeconds
(Object value, long seconds) Adds seconds to the defined value.Adds weeks to the defined value.Adds years to the defined value.long
secondsBetween
(Object firstValue, Object secondValue) Get the number of seconds between two values.long
secondsBetweenDates
(Object firstValue, Object secondValue) Deprecated.long
secondsOfDuration
(String iso8601Duration) Gets the number of seconds in a ISO duration string, e.g.long
weeksBetween
(Object firstValue, Object secondValue) Get the number of weeks between two values.long
yearsBetween
(Object firstValue, Object secondValue) Get the number of years between two values.
-
Constructor Details
-
FlowableExpressionTimeUtils
public FlowableExpressionTimeUtils()
-
-
Method Details
-
parseInstant
Parse an ISO 8601 String to Instant.- Parameters:
instantIsoString
- the ISO 8601 String, nevernull
- Returns:
- the Instant representing the ISO 8601 String
-
parseInstant
Parse the object in to an Instant Supported inputs are:- String
- Json TextNode
null
- Parameters:
value
- the object that should be parsedpattern
- the pattern that should be used for the parsing- Returns:
- the Instant representing the object, or
null
if the object was null
-
parseLocalDate
Parse the object in to a LocalDate Supported inputs are:- String
- Json TextNode
null
- Parameters:
value
- the object that should be parsedpattern
- the pattern that should be used for parsing- Returns:
- the LocalDate representing the object, or
null
if the object was null
-
parseLocalDateTime
Parse the object in to a LocalDateTime Supported inputs are:- String
- Json TextNode
null
- Parameters:
value
- the object that should be parsedpattern
- the pattern that should be used for parsing- Returns:
- the LocalDateTime representing the object, or
null
if the object was null
-
asInstant
Converts a value to an Instant. Supported inputs are:- Date
- Instant - it will return itself
- LocalDate - It will use the start of day in the UTC zone
- LocalDateTime - It will use the UTC zone
- ISO 8601 String - also supports LocalDate and LocalDateTime values
null
- Parameters:
value
- the value to be converted- Returns:
- An
Instant
based on the provided value.
-
asInstant
Converts a value to an Instant in the given zone. Supported inputs are:- Date
- Instant - it will return itself
- LocalDate - It will use the start of day in the requested zone
- LocalDateTime - It will use the requested zone
- ISO 8601 String - also supports LocalDate and LocalDateTime values
null
zoneId
is only used when the value is a LocalDate, LocalDateTime or a String representing a LocalDate or LocalDateTime- Parameters:
value
- the value to be convertedzoneId
- the zone that should be used for converting a LocalDate or LocalDateTime- Returns:
- An
Instant
based on the provided value.
-
asInstant
-
asLocalDate
Converts a value to a LocalDate. Supported inputs are:- Parameters:
value
- the value to be converted- Returns:
- A
LocalDate
based on the provided value.
-
asLocalDate
Converts a value to a LocalDate in the given zone. Supported inputs are:- Date - It will use the
LocalDate
in the provided zone - Instant - It will use the
LocalDate
in the provided zone - LocalDate
- LocalDateTime
- ISO 8601 String - also supports Instant, LocalDate and LocalDateTime values
null
zoneId
is only used when the value is an Instant, Date or a String representing an Instant- Parameters:
value
- the value to be convertedzoneId
- the zone that should be used for converting a LocalDate or LocalDateTime- Returns:
- A
LocalDate
based on the provided value.
- Date - It will use the
-
asLocalDate
-
asLocalDateTime
Converts a value to a LocalDateTime. Supported inputs are:- Date - It will use the
LocalDateTime
in the UTC zone - Instant - It will use the
LocalDateTime
in the UTC zone - LocalDate - It will use start of day
- LocalDateTime
- ISO 8601 String - also supports Instant, LocalDate and LocalDateTime values
null
- Parameters:
value
- the value to be converted- Returns:
- A
LocalDateTime
based on the provided value.
- Date - It will use the
-
asLocalDateTime
Converts a value to a LocalDateTime in the given zone. Supported inputs are:- Date - It will use the
LocalDateTime
in provided zone - Instant - It will use the
LocalDateTime
in provided zone - LocalDate - It will use start of date
- LocalDateTime
- ISO 8601 String - also supports Instant, LocalDate and LocalDateTime values
null
zoneId
is only used when the value is an Instant, Date or a String representing an Instant- Parameters:
value
- the value to be convertedzoneId
- the zone that should be used for converting a LocalDate or LocalDateTime- Returns:
- A
LocalDateTime
based on the provided value.
- Date - It will use the
-
asLocalDateTime
-
asDate
Converts a value to a date. This is useful in places where the old Java Date API is still used. Supported inputs are:- Instant
- LocalDate - It will use the start of day in the UTC zone
- LocalDateTime - It will use the UTC zone
- ISO 8601 String - also supports LocalDate and LocalDateTime values
null
- Parameters:
value
- the value to be converted- Returns:
- A
Date
based on the provided value.
-
atTime
Sets the time of the value to the specified hours, minutes and seconds. The ZoneOffset is UTC. The value can be:- Date
- Instant
- LocalDateTime
- ISO 8601 String - It will return an Instant or LocalDateTime
- Parameters:
value
- the basishours
- the hours to be setminutes
- the minutes to be setseconds
- the seconds to be set- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
atTimeWithTimeZone
public Object atTimeWithTimeZone(Object value, int hours, int minutes, int seconds, String timezoneId) Sets the time of the value to the specified hours, minutes and seconds in the given timezone. The value can be:- Date
- Instant
- LocalDateTime
- ISO 8601 String - It will return an Instant or LocalDateTime
- Parameters:
value
- the basishours
- the hours to be setminutes
- the minutes to be setseconds
- the seconds to be settimezoneId
- the time zone- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
atTimeZone
Returns an instant at a specified time zone.
This is useful in application where more than one time zone is involved and users in different time zones
receive dates offset to their specific time zones.
Example:#{flwTimeUtils.atTimeZone(flwTimeUtils.now(), 'Europe/Zurich')}
will return the current time in Zurich
A list of all available time zones can be received withgetAvailableTimeZoneIds()
A more or less up-to-date list can also be found here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones ATTENTION: This is for display purposes only, never store a date in a specific time zone! -
getAvailableTimeZoneIds
Receives a list of all available timeZoneIds maintained as specified by the IANA.
Use this method if you want to provide a selection of time zones to an end user.- Returns:
- A list of valid time zones usable with
atTimeZone(Object, String)
-
getField
Obtains a "slice of time" by specifying aChronoField
asString
.
The method supports both, the display name and the enum name of ChronoFields.
Example:#{flwTimeUtils.getField(flwTimeUtils.now(), "DAY_OF_WEEK")}
to obtain the current day of the week
Example:#{flwTimeUtils.getField(flwTimeUtils.now(), "SECOND_OF_MINUTE")}
to obtain the seconds in the current minute
Example:#{flwTimeUtils.getField(flwTimeUtils.now(), "AlignedWeekOfYear")}
to obtain the calendar week. This example uses the display name of the Chrono Field.
A list of all Chrono Fields can be found here:
https://docs.oracle.com/javase/8/docs/api/java/time/temporal/ChronoField.html. Supports input for:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
value
- from which te time should be extractedchronoFieldString
- the name of a chrono field, seeChronoField
- Returns:
- An
int
representing the desiredChronoField
of the instance in UTC.
-
isWeekend
Determines whether the current day is a weekend. It can check the following types:- Date
- Instant - The check is done in the UTC zone
- LocalDate
- LocalDateTime
- ISO 8601 String
-
fullDateTimeInstant
Constructs anInstant
based on a given year, month, day, hour, minute and second.- Parameters:
year
- the year to usemonth
- the month to useday
- the day to usehour
- the hour to useminute
- the minute to usesecond
- the second to use- Returns:
- An
Instant
-
fullDateTimeDate
Constructs anDate
based on a given year, month, day, hour, minute and second.- Parameters:
year
- the year to usemonth
- the month to useday
- the day to usehour
- the hour to useminute
- the minute to usesecond
- the second to use- Returns:
- An
Date
-
plusSeconds
Adds seconds to the defined value. Supports the following input:- Date
- Instant
- LocalDateTime
- ISO 8601 String - It will return an Instant or LocalDateTime
- Parameters:
value
- the basisseconds
- the number of seconds to add- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
plusMinutes
Adds minutes to the defined value. Supports the following input:- Date
- Instant
- LocalDateTime
- ISO 8601 String - It will return an Instant or LocalDateTime
- Parameters:
value
- the basisminutes
- the number of minutes to add- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
plusHours
Adds hours to the defined value. Supports the following input:- Date
- Instant
- LocalDateTime
- ISO 8601 String - It will return an Instant or LocalDateTime
- Parameters:
value
- the basishours
- the number of hours to add- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
plusDays
Adds days to the defined value. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String - It will return an Instant, LocalDate or LocalDateTime
- Parameters:
value
- the basisdays
- the number of days to add- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
plusWeeks
Adds weeks to the defined value. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String - It will return an Instant, LocalDate or LocalDateTime
- Parameters:
value
- the basisweeks
- the number of weeks to add- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
plusMonths
Adds months to the defined value. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String - It will return an Instant, LocalDate or LocalDateTime
- Parameters:
value
- the basismonths
- the number of months to add- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
plusYears
Adds years to the defined value. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String - It will return an Instant, LocalDate or LocalDateTime
- Parameters:
value
- the basisyears
- the number of years to add- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
plusDuration
Adds an ISO8601-encoded duration to the value.Example:
#{flwTimeUtils.plusDuration(flwTimeUtils.now(), 'P1Y')}
adds a yearExample:
#{flwTimeUtils.plusDuration(flwTimeUtils.now(), 'P14D')}
adds 14 daysExample:
#{flwTimeUtils.plusDuration(flwTimeUtils.now(), 'PT30M10S')}
adds 30 minutes and ten secondsSupports the following input:
- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String - It will return an Instant, LocalDate or LocalDateTime
- Parameters:
value
- the basisiso8601Duration
- the duration to be added to the value- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
minusSeconds
Subtracts seconds from the defined value. Supports the following input:- Date
- Instant
- LocalDateTime
- ISO 8601 String - It will return an Instant or LocalDateTime
- Parameters:
value
- the basisseconds
- the number of seconds to subtract- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
minusMinutes
Subtracts minutes from the defined value. Supports the following input:- Date
- Instant
- LocalDateTime
- ISO 8601 String - It will return an Instant or LocalDateTime
- Parameters:
value
- the basisminutes
- the number of minutes to subtract- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
minusHours
Subtracts hours from the defined value. Supports the following input:- Date
- Instant
- LocalDateTime
- ISO 8601 String - It will return an Instant or LocalDateTime
- Parameters:
value
- the basishours
- the number of hours to subtract- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
minusDays
Subtracts days from the defined value. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String - It will return an Instant, LocalDate or LocalDateTime
- Parameters:
value
- the basisdays
- the number of days to subtract- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
minusWeeks
Subtracts weeks from the defined value. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String - It will return an Instant, LocalDate or LocalDateTime
- Parameters:
value
- the basisweeks
- the number of weeks to subtract- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
minusMonths
Subtracts months from the defined value. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String - It will return an Instant, LocalDate or LocalDateTime
- Parameters:
value
- the basismonths
- the number of months to subtract- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
minusYears
Subtracts years from the defined value. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String - It will return an Instant, LocalDate or LocalDateTime
- Parameters:
value
- the basisyears
- the number of years to subtract- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
minusDuration
Subtracts an ISO8601-encoded duration to the value.Example:
#{flwTimeUtils.minusDuration(flwTimeUtils.now(), 'P1Y')}
subtracts a yearExample:
#{flwTimeUtils.minusDuration(flwTimeUtils.now(), 'P14D')}
subtracts 14 daysExample:
#{flwTimeUtils.minusDuration(flwTimeUtils.now(), 'PT30M10S')}
subtracts 30 minutes and ten secondsSupports the following input:
- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String - It will return an Instant, LocalDate or LocalDateTime
- Parameters:
value
- the basisiso8601Duration
- the duration to be subtracted from the value- Returns:
- A new basis type, with the same type as the
value
(unless it is a string)
-
secondsOfDuration
Gets the number of seconds in a ISO duration string, e.g. PT60M returns 3600.- Parameters:
iso8601Duration
- the ISO 8601 duration string, nevernull
- Returns:
- Number of seconds in the given duration
-
currentDate
Returns the current date at 00:00 AM UTC.- Returns:
- An
Instant
of the current date at 00:00 AM UTC.
-
isBefore
Checks if the first value is before the second value. The check is done by converting the second value to the same type as the first one. It allows comparing:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
firstValue
- first value to comparesecondValue
- second value to which to compare to- Returns:
true
if the first value is before the second one,false otherwise
-
isBeforeOrEqual
Checks if the first value is before or equals to the second value. The check is done by converting the second value to the same type as the first one. It allows comparing:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
firstValue
- first value to comparesecondValue
- second value to which to compare to- Returns:
true
if the first value is before the second one,false otherwise
-
isAfter
Checks if the first value is after the second value. The check is done by converting the second value to the same type as the first one. It allows comparing:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
firstValue
- first value to comparesecondValue
- second value to which to compare to- Returns:
true
if the first value is after the second one,false otherwise
-
isAfterOrEqual
Checks if the first value is after or equal to the second value. The check is done by converting both values to an Instant and then comparing them. It allows comparing:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
firstValue
- first value to comparesecondValue
- second value to which to compare to- Returns:
true
if the first value is after the second one,false otherwise
-
areEqual
Checks if the first value is equal to the second value. The check is done by converting the second value to the same type as the first one. It allows comparing:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
firstValue
- first value to comparesecondValue
- second value to which to compare to- Returns:
true
if the first value is equal to the second one,false otherwise
-
isBeforeTime
Checks if the givenvalue
is before a certain time in a given time zone. The value can be- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
The conversion is done by converting the
value
into an instant in the given time zone.- Parameters:
value
- to compare the time totimeZoneId
- the time zone in which to do the comparisonhours
- hour within the same dayminutes
- minutes within the hourseconds
- seconds within the minute- Returns:
true
if the value is before the given time,false otherwise
-
isAfterTime
Checks if the givenvalue
is after a certain time in a given time zone. The value can be- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
The conversion is done by converting the
value
into an instant in the given time zone.- Parameters:
value
- to compare the time totimeZoneId
- the time zone in which to do the comparisonhours
- hour within the same dayminutes
- minutes within the hourseconds
- seconds within the minute- Returns:
true
if the value is after the given time,false otherwise
-
secondsBetweenDates
Deprecated.usesecondsBetween(Object, Object)
insteadReturns the number of seconds between two values. Each value will be converted to an Instant in the UTC timezone before doing the comparison. The values can be- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
firstValue
- the first valuesecondValue
- the second value- Returns:
- Number of seconds between the two values
-
getFieldFromDurationBetweenDates
public long getFieldFromDurationBetweenDates(Object firstDateOrInstant, Object secondDateOrInstant, String chronoUnitString) Gets the duration between two values. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
firstDateOrInstant
- the firstDate
orInstant
secondDateOrInstant
- the secondDate
orInstant
chronoUnitString
- chrono Unit to be extracted, e.g. 'Seconds' or 'Days', seeChronoUnit
for available values- Returns:
- the duration between the two values in the specific unit
-
secondsBetween
Get the number of seconds between two values. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
firstValue
- the first valuesecondValue
- the second value- Returns:
- the number of seconds between the two values
-
minutesBetween
Get the number of minutes between two values. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
firstValue
- the first valuesecondValue
- the second value- Returns:
- the number of minutes between the two values
-
hoursBetween
Get the number of hours between two values. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
firstValue
- the first valuesecondValue
- the second value- Returns:
- the number of hours between the two values
-
daysBetween
Get the number of days between two values. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
firstValue
- the first valuesecondValue
- the second value- Returns:
- the number of days between the two values
-
weeksBetween
Get the number of weeks between two values. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
firstValue
- the first valuesecondValue
- the second value- Returns:
- the number of weeks between the two values
-
monthsBetween
Get the number of months between two values. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
firstValue
- the first valuesecondValue
- the second value- Returns:
- the number of months between the two values
-
yearsBetween
Get the number of years between two values. Supports the following input:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
firstValue
- the first valuesecondValue
- the second value- Returns:
- the number of years between the two values
-
getDurationBetween
-
getTimeZoneOffset
Calculates the number of seconds a specific point in time at a specified time zone is set off from UTC. The value can be:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
Example:
#{flwTimeUtils.getTimZoneOffset(flwTimeUtils.now(), "Pacific/Honolulu)}
calculates the number of seconds between Honolulu and UTC time- Parameters:
value
- the date you want to check the offset attimeZoneId
- the time zone- Returns:
- The offset in seconds
-
instantFromTimestamp
Returns an instant from the number of seconds that have passed since the first of January 1970 (Unix Timestamp).- Parameters:
timestamp
-- Returns:
- Instant at the specified time stamp.
-
dateFromTimestamp
Returns a date from the number of seconds that have passed since the first of January 1970 (Unix Timestamp).- Parameters:
timestamp
-- Returns:
Date
at the specified time stamp.
-
now
Returns the current date and time in UTC.- Returns:
- Current date and time
-
currentLocalDate
-
currentLocalDateTime
-
secondsBetween(Object, Object)
instead