Skip to main content

Date & Time Functions

Date and Time Functions in FlowOn Logic allow you to manipulate and work with date and time values. These functions enable you to perform various operations, such as formatting dates, calculating time differences, and extracting specific date components. With Date and Time Functions, you can efficiently manage and analyze date and time-related data within your functions.

Add Days

This function allows you to add days to a specific valid timestamp.

    AddDays('<Timestamp>', '<Number of Days>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp to which days will be added.
Number of DaysYesIntegerThe number of days to add.
Return valueDateTimeThe new timestamp after adding the days.
  • Example
    AddDays("09/03/2023 03:56 PM", 2)
Result: "09/05/2023 03:56 PM"

Add Hours

This function allows you to add hours to a specific valid timestamp.

    AddHours('<Timestamp>', '<Number of Hours>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp to which hours will be added.
Number of HoursYesIntegerThe number of hours to add.
Return valueDateTimeThe new timestamp after adding the hours.
  • Example
    AddHours("09/03/2023 12:00:00 PM", 5)
Result: "09/03/2023 05:00:00 PM"

Add Minutes

This function allows you to add minutes to a specific valid timestamp.

    AddMinutes('<Timestamp>', '<Number of Minutes>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp to which minutes will be added.
Number of MinutesYesIntegerThe number of minutes to add.
Return valueDateTimeThe new timestamp after adding the minutes.
  • Example
    AddMinutes("09/03/2023 12:00:00 PM", 30)
Result: "09/03/2023 12:30:00 PM"

Add Month

This function allows you to add months to a specific valid timestamp.

    AddMonth('<Timestamp>', '<Number of Months>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp to which months will be added.
Number of MonthsYesIntegerThe number of months to add.
Return valueDateTimeThe new timestamp after adding the months.
  • Example
    AddMonth("09/03/2023 10:00:00 AM", 1)
Result: "09/03/2023 10:00:00 AM"

Add Seconds

This function allows you to add seconds to a specific valid timestamp.

    AddSeconds('<Timestamp>', '<Number of Seconds>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp to which seconds will be added.
Number of SecondsYesIntegerThe number of seconds to add.
Return valueDateTimeThe new timestamp after adding the seconds.
  • Example
    AddSeconds("09/03/2023 12:00:00 PM", 20)
Result: "09/03/2023 12:00:20 PM"

Add Years

This function allows you to add years to a specific valid timestamp.

    AddYears('<Timestamp>', '<Number of Years>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp to which years will be added.
Number of YearsYesIntegerThe number of years to add.
Return valueDateTimeThe new timestamp after adding the years.
  • Example
    AddYears("09/03/2023 12:30:20 PM", 2)
Result: "09/03/2025 12:30:20 PM"

UTC To Time Zone

This function allows you to convert a timestamp from UTC to the target time zone.

    UTCToTimeZone('<Timestamp>', '<TargetTimeZone>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe UTC timestamp to be converted.
TargetTimeZoneYesStringThe target time zone.
Return valueDateTimeThe converted timestamp in the target time zone.
  • Example
    UTCToTimeZone("09/03/2023 12:00:00 PM", "EDT")
Result: "09/03/2023 08:00:00 AM EDT"

Convert Time Zone

This function allows you to convert a timestamp from the source time zone to the target time zone.

    ConvertTimeZone('<Timestamp>', '<SourceTimeZone>', '<TargetTimeZone>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp in the source time zone.
SourceTimeZoneYesStringThe source time zone.
TargetTimeZoneYesStringThe target time zone.
Return valueDateTimeThe converted timestamp in the target time zone.
  • Example
    ConvertTimeZone("09/03/2023 12:00:00 PM", "EDT", "PDT")
Result: "09/03/2023 09:00:00 AM PDT"

Time Zone To UTC

This function allows you to convert a timestamp from the target time zone to UTC.

    TimeZoneToUTC('<Timestamp>', '<SourceTimeZone>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp in the source time zone.
SourceTimeZoneYesStringThe source time zone.
Return valueDateTimeThe converted UTC timestamp.
  • Example
    TimeZoneToUTC("11/03/2023 12:00:00 PM", "EST")
Result: "11/03/2023 05:00:00 PM UTC"

Parse Timestamp From String

This function allows you to extract a timestamp from the provided string.

    ParseTimestampFromString('<String>')
ParameterRequiredTypeDescription
StringYesStringThe string containing the timestamp.
Return valueDateTimeThe extracted timestamp.
  • Example
    ParseTimestampFromString("The event is on 09/09/2023 10:00:00 PM")
Result: "09/09/2023 10:00:00 PM"

Start Of Day

This function returns the start of the day for a timestamp.

    StartOfDay('<Timestamp>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp for which the start of the day is needed.
Return valueDateTimeThe timestamp representing the start of the day.
  • Example
    StartOfDay("09/03/2023 12:45:00 PM")
Result: "09/03/2023 00:00:00 AM"

Start Of Hour

This function returns the start of the hour for a timestamp.

    StartOfHour('<Timestamp>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp for which the start of the hour is needed.
Return valueDateTimeThe timestamp representing the start of the hour.
  • Example
    StartOfHour("09/03/2023 12:45:00 PM")
Result: "09/03/2023 12:00:00 PM"

Start Of Month

This function returns the start of the month for a timestamp.

    StartOfMonth('<Timestamp>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp for which the start of the month is needed.
Return valueDateTimeThe timestamp representing the start of the month.
  • Example
    StartOfMonth("08/04/2023 12:45:00 PM")
Result: "08/01/2023 12:45:00 PM"

Get Current UTC Timestamp

This function allows you to get the current timestamp in UTC format.

    GetCurrentUTCTimestamp()
ParameterRequiredTypeDescription
Return valueDateTimeThe current timestamp in UTC format.
  • Example
    GetCurrentUTCTimestamp()
Result: "09/03/2023 12:45:00 PM" # Example output

Get Day from Timestamp

This function allows you to get the day component as a number from a timestamp.

    GetDayFromTimestamp('<Timestamp>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp from which the day component is extracted.
Return valueIntegerThe day component as a number.
  • Example
    GetDayFromTimestamp("09/03/2023 12:45:00 PM")
Result: 3

Get Day Difference

This function allows you to get the difference in days as a number between two timestamps.

    GetDayDifference('<Timestamp1>', '<Timestamp2>')
ParameterRequiredTypeDescription
Timestamp1YesDateTimeThe first timestamp.
Timestamp2YesDateTimeThe second timestamp.
Return valueIntegerThe difference in days between the two timestamps.
  • Example
    GetDayDifference("09/03/2023", "09/10/2023")
Result: 7

Get Day Of Week

This function allows you to get the number of the day from the week.

    GetDayOfWeek('<Timestamp>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp from which the day of the week is required.
Return valueIntegerThe number representing the day of the week.
  • Example
    GetDayOfWeek("09/03/2023")
Result: 7

Get Month

This function allows you to get the month component as a number from a timestamp.

    GetMonth('<Timestamp>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp from which the month component is required.
Return valueIntegerThe month component of the timestamp.
  • Example
    GetMonth("11/03/2023")
Result: 11

Get Month Difference

This function allows you to get the difference in months as a number between two timestamps.

    GetMonthDifference('<Timestamp1>', '<Timestamp2>')
ParameterRequiredTypeDescription
Timestamp1YesDateTimeThe first timestamp.
Timestamp2YesDateTimeThe second timestamp.
Return valueIntegerThe difference in months between the two timestamps.
  • Example
    GetMonthDifference("09/03/2023", "12/03/2023")
Result: 3

Get Ticks From Timestamp

This function allows you to get the tick property value from a timestamp.

    GetTicksFromTimestamp('<Timestamp>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp from which the tick value is required.
Return valueLongThe tick value of the timestamp.
  • Example
    GetTicksFromTimestamp("09/03/2023 12:45:00 PM")
Result: 6.38293419

Get Year

This function allows you to get the year component as a number from a timestamp.

    GetYear('<Timestamp>')
ParameterRequiredTypeDescription
TimestampYesDateTimeThe timestamp from which the year component is required.
Return valueIntegerThe year component of the timestamp.
  • Example
    GetYear("09/03/2027")
Result: 2027

Get Year Difference

This function allows you to get the difference in years as a number between two timestamps.

    GetYearDifference('<Timestamp1>', '<Timestamp2>')
ParameterRequiredTypeDescription
Timestamp1YesDateTimeThe first timestamp.
Timestamp2YesDateTimeThe second timestamp.
Return valueIntegerThe difference in years between the two timestamps.
  • Example
    GetYearDifference("09/03/2023", "01/01/2029")
Result: 6

What's Next

In this section, we've explored various date and time functions in FlowOn logic and learned how to apply them effectively. In the next section, we'll delve into Math functions for further understanding and application.