Calculating hours between private data timestamp and current time (no scripting module)
Posted: Sat Oct 25, 2025 3:02 am
Hey everyone —
I’m trying to calculate the number of hours elapsed between a private data timestamp and the current system time inside Switch.
Here’s what I’m working with:
• Private data key: mil_ArtToProduction
• Value format: 2025-10-24T16:00:00Z
• Goal: Create a new private data key (for example, HoursSinceArtToProduction) that represents how many hours have passed between that timestamp and now.
The challenge is that I don’t have the Scripting Module, so I can’t rely on JavaScript or custom scripting to handle the calculation directly. I’ve tried a few different approaches using built-in Switch tools (Private Data Magician, Date Calculator, etc.), but it seems like Switch doesn’t interpret the ISO timestamp as a date/time — it just sees it as plain text.
Has anyone found a reliable way to perform this kind of calculation without the scripting module? Ideally I’d like to calculate the elapsed time in hours and store it as a new private data key for use later in the flow.
Any advice or examples would be greatly appreciated!
I’m trying to calculate the number of hours elapsed between a private data timestamp and the current system time inside Switch.
Here’s what I’m working with:
• Private data key: mil_ArtToProduction
• Value format: 2025-10-24T16:00:00Z
• Goal: Create a new private data key (for example, HoursSinceArtToProduction) that represents how many hours have passed between that timestamp and now.
The challenge is that I don’t have the Scripting Module, so I can’t rely on JavaScript or custom scripting to handle the calculation directly. I’ve tried a few different approaches using built-in Switch tools (Private Data Magician, Date Calculator, etc.), but it seems like Switch doesn’t interpret the ISO timestamp as a date/time — it just sees it as plain text.
Has anyone found a reliable way to perform this kind of calculation without the scripting module? Ideally I’d like to calculate the elapsed time in hours and store it as a new private data key for use later in the flow.
Any advice or examples would be greatly appreciated!