Skip to content

TimezoneFormatAction lets Salesforce Flows format UTC DateTimes for a specific IANA time zone. It returns a friendly, localized string plus useful parts like month/day/hour, 12h and 24h time strings, and time zone details.

Notifications You must be signed in to change notification settings

NormCopeland/timeZoneFormatAction

Repository files navigation

TimezoneFormatAction (Flow Invocable)

TimezoneFormatAction lets Salesforce Flows format UTC DateTimes for a specific IANA time zone (for example, "America/New_York"). It returns a friendly, localized string plus useful parts like month/day/hour, 12h and 24h time strings, and time zone details (abbreviation, ID, and whether Daylight Saving Time is in effect). Use it to present timezone-aware dates/times without building complex logic in Flow.

Examples

  • Convert GMT to a local time: Given inputDateTimeUtc = 2025-09-18 17:00:00Z and ianaTimezone = "America/New_York", the action returns formatted like "September 18th, 2025, 1:00 PM EDT" along with fields such as hour24 = 13, tzAbbrev = "EDT", isDST = true.
  • 24-hour time without seconds and no TZ label: Set use24HourFormat = true, includeSeconds = false, includeTzAbbrev = false. The formatted output becomes a clean 24h string (e.g., "Sep 18, 2025, 13:00").
  • Use timezone identifiers directly: You can reference tzId (e.g., "America/Los_Angeles") and tzAbbrev (e.g., "PDT") from the output to display or store time zone metadata elsewhere in Flow.

Inputs and Outputs

Inputs

Name Type Required Default Purpose
inputDateTimeUtc Datetime Yes UTC datetime to convert.
ianaTimezone String Yes IANA zone like "America/New_York".
use24HourFormat Boolean No false Use 24-hour time in the composed formatted output.
includeSeconds Boolean No false Include seconds in time strings.
includeTzAbbrev Boolean No true Include timezone short name (e.g., EDT) in formatted.
monthStyle String No long Month style: long, short, or numeric.
includeOrdinal Boolean No true Use ordinal day (e.g., 18th) in formatted.

Outputs

Name Type Purpose
formatted String Human-friendly localized string (e.g., "September 18th, 2025, 1:00 PM EDT").
monthName String Month label per style (e.g., "September", "Sep", or "09").
monthNumber Integer Numeric month 1–12.
dayOfMonth Integer Day of month (no suffix).
dayOrdinal String Day with ordinal (e.g., "18th").
year Integer Four-digit year.
hour12 Integer 12-hour clock hour 1–12.
hour24 Integer 24-hour clock hour 0–23.
minute Integer Minute 0–59.
second Integer Second 0–59.
amPm String "AM" or "PM".
time12 String Time as 12-hour string.
time24 String Time as 24-hour string.
tzAbbrev String Timezone abbreviation (e.g., "EST", "EDT").
tzId String IANA zone ID returned (e.g., "America/New_York").
isDST Boolean Whether Daylight Saving Time is observed for the instant.
isoLocal String ISO-like local string (YYYY-MM-DDThh:mm:ss).

About

TimezoneFormatAction lets Salesforce Flows format UTC DateTimes for a specific IANA time zone. It returns a friendly, localized string plus useful parts like month/day/hour, 12h and 24h time strings, and time zone details.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published