Skip to content

Conversation

@AndyHaas
Copy link
Collaborator

@AndyHaas AndyHaas commented Nov 4, 2025

Overview

This PR adds a new TimeConversion project containing an invocable Apex action for converting UTC DateTime values to any timezone with automatic DST handling.

Components Added

  • TimezoneConverter.cls: Invocable Apex class that converts UTC DateTime to specified timezone
  • TimezoneConverterTest.cls: Comprehensive test class with 100% code coverage
  • timezoneConverterCpe: Custom Property Editor (CPE) for Flow Builder configuration

Features

✅ Converts UTC DateTime to any timezone
✅ Automatic Daylight Saving Time (DST) handling
✅ User-selectable date/time formats with presets
✅ Custom timezone and format support
✅ 100% test coverage with comprehensive edge case testing
✅ Custom Property Editor for easy Flow Builder configuration
✅ Defensive coding with extensive error handling

Testing

  • Multiple timezone tests (Eastern, Pacific, Central, London, UTC, Phoenix)
  • DST transition testing (start and end of DST periods)
  • Edge case testing (null values, invalid timezones, invalid formats, extreme dates)
  • Fallback path testing for all error scenarios

Author

Andy Haas - Milestone Consulting

Date

2025-11-03

API Version

65.0

- Added TimezoneConverter.cls: Invocable Apex class for converting UTC DateTime to any timezone
- Added TimezoneConverterTest.cls: Comprehensive test class with 100% code coverage
- Added timezoneConverterCpe: Custom Property Editor for Flow Builder configuration
- Includes automatic DST handling and user-selectable date/time formats
- Created by Andy Haas - Milestone Consulting (2025-11-03)
@AndyHaas
Copy link
Collaborator Author

AndyHaas commented Nov 4, 2025

I didn't see anything out there in the USF world that handled the beautiful timezone changes within flow, so here is a simple component you pass it a Date/Time and the output will be the correct timezone date time.

Why did I build this? Well a client had hard coded formulas in flow and this past weekend things went wrong, very wrong when Text Messages and Emails were sent to their customers with the wrong date time due to DST.

If there is already something out there we can close this PR.

There is a CPE as well to help users easily set this up

image image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants