Expression Language
Create calculated attributes, define conditions, and transform data using ProcessMind's expression language.
Functions for extracting date/time components and performing date arithmetic.
In ProcessMind, timestamps are stored as numbers representing milliseconds since January 1, 1970 (Unix epoch). The date functions work with these timestamp values.
Extract date parts:
year(StartTime) // 2024
month(StartTime) // 3 (March)
day(StartTime) // 15 Calculate duration:
dateDiff(StartTime, EndTime, "minute")
dateDiff(StartTime, EndTime, "hour")
dateDiff(StartTime, EndTime, "day") Create time buckets:
bucket(hour(StartTime), 6, "Night", 12, "Morning", 18, "Afternoon", "Evening") Add time to a date:
dateAdd(StartTime, 7, "day") // Add 7 days
dateAdd(StartTime, -1, "month") // Subtract 1 month Returns the current UTC timestamp, in milliseconds since the Unix epoch.
| Returns | number |
| Examples | now() → 1708963200000 Current timestamp |
Extracts the year from a timestamp.
| Parameters |
| |||
| Returns | number | |||
| Examples | year(StartTime) → 2024 | |||
| See Also |
Extracts the month, 1-12, from a timestamp.
| Parameters |
| |||
| Returns | number | |||
| Examples | month(StartTime) → 3 March | |||
| See Also |
Extracts the day of the month, 1-31, from a timestamp.
| Parameters |
| |||
| Returns | number | |||
| Examples | day(StartTime) → 18 | |||
| See Also |
Extracts the hour, 0-23, from a timestamp.
| Parameters |
| |||
| Returns | number | |||
| Examples | hour(StartTime) → 14 2 PM | |||
| See Also |
Extracts the minute, 0-59, from a timestamp.
| Parameters |
| |||
| Returns | number | |||
| Examples | minute(StartTime) → 30 | |||
| See Also |
Extracts the second, 0-59, from a timestamp.
| Parameters |
| |||
| Returns | number | |||
| Examples | second(StartTime) → 45 | |||
| See Also |
Returns the day of the week, 1=Monday and 7=Sunday, from a timestamp.
| Parameters |
| |||
| Returns | number | |||
| Examples | dayOfWeek(StartTime) → 1 Monday | |||
| See Also |
Returns the day of the week by name from a timestamp.
| Parameters |
| |||
| Returns | string | |||
| Examples | dayName(StartTime) → Monday | |||
| See Also |
Returns the month name from a timestamp.
| Parameters |
| |||
| Returns | string | |||
| Examples | monthName(StartTime) → March | |||
| See Also |
Returns the quarter, 1-4, from a timestamp.
| Parameters |
| |||
| Returns | number | |||
| Examples | quarter(StartTime) → 1 Q1 (Jan-Mar) | |||
| See Also |
Returns the ISO week number, 1-53, from a timestamp.
| Parameters |
| |||
| Returns | number | |||
| Examples | weekOfYear(StartTime) → 12 Week 12 of 2024 | |||
| See Also |
Returns the day of the year, 1-366, from a timestamp.
| Parameters |
| |||
| Returns | number | |||
| Examples | dayOfYear(StartTime) → 78 78th day of the year (March 18, 2024) | |||
| See Also |
Adds a specified amount of time to a timestamp.
| Parameters |
| |||||||||
| Returns | number | |||||||||
| Examples | dateAdd(StartTime, 7, "day") → timestamp + 7 days dateAdd(StartTime, -1, "month") → timestamp - 1 month dateAdd(1710766245000, 1, "day") → 1710852645000 Add 1 day to March 18, 2024 | |||||||||
| See Also |
Calculates the difference between two timestamps in the specified unit.
| Parameters |
| |||||||||
| Returns | number | |||||||||
| Examples | dateDiff(StartTime, EndTime, "minute") → 150 Duration in minutes dateDiff(StartTime, EndTime, "hour") → 2.5 | |||||||||
| Notes | Returns a decimal value representing the exact difference. | |||||||||
| See Also |
Checks whether a timestamp falls on a business day, Monday through Friday.
| Parameters |
| |||
| Returns | boolean | |||
| Examples | isBusinessDay(StartTime) → true If StartTime is a weekday | |||
| See Also |
Counts the business days, Monday through Friday, between two timestamps.
| Parameters |
| ||||||
| Returns | number | ||||||
| Examples | workingDaysBetween(StartTime, EndTime) → Number of weekdays between the dates workingDaysBetween(1710766245000, 1711371045000) → 5 5 working days between Mon Mar 18 and Mon Mar 25, 2024 | ||||||
| Notes | Approximate backend/business-calendar helper. It does not account for holidays, only weekends. | ||||||
| See Also |
Converts a local timestamp to UTC by subtracting the offset.
| Parameters |
| ||||||
| Returns | number | ||||||
| Examples | toUtc(StartTime, 2) → StartTime - 2 hours Convert from UTC+2 toUtc(1710766245000, 2) → 1710759045000 Convert timestamp from UTC+2 to UTC | ||||||
| Notes | Timezone conversion currently supports numeric UTC offsets in hours, not IANA timezone names. | ||||||
| See Also |
Converts a UTC timestamp to local time by adding the offset.
| Parameters |
| ||||||
| Returns | number | ||||||
| Examples | toLocal(StartTime, -5) → StartTime - 5 hours Convert to EST toLocal(1710766245000, -5) → 1710748245000 Convert UTC timestamp to EST (UTC-5) | ||||||
| Notes | Timezone conversion currently supports numeric UTC offsets in hours, not IANA timezone names. | ||||||
| See Also |
Converts a timestamp from one timezone to another.
| Parameters |
| |||||||||
| Returns | number | |||||||||
| Examples | convertTimezone(StartTime, 1, -5) → timestamp adjusted -6 hours CET to EST convertTimezone(1710766245000, 1, -5) → 1710744645000 Convert from UTC+1 to UTC-5 | |||||||||
| Notes | Timezone conversion currently supports numeric UTC offsets in hours, not IANA timezone names. | |||||||||
| See Also |