Convert String format to UTC

Hi,
I want convert “04-29-2023_140637” this date time format to
“2023-04-29T15:25:53.168Z” using apama epl.

please help me with a code snippet

You can use the TimeFormat event library.
Using the TimeFormat event library (softwareag.com)

using com.apama.correlator.timeformat.TimeFormat;
...

	action convertDateTime(string str) returns string {
		return TimeFormat.formatUTC(TimeFormat.parseTimeUTC("MM-dd-yyyy_HHmmss", str), "yyyy-MM-dd'T'HH:mm:ss.SSSX");
	}

I hope that helps.

2 Likes

Hi @joel.dockray

Thank you for the reply.
This code working fine.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.