Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Yes an other Unparsable date/time question here. I know, there are a lot out there, but I could not find any suitable for my case.
I get date/time values. In a tExtractJSONFields I'm able to get most of them with format
"yyyy-MM-dd'T'HH:mm:ss.SSSSSS"
But. . . . . this fails when a date/time has (for example) the following value :
2025-11-12T17:29:36
No miliseconds, no dot what so ever.
How to handle vlaues like these ???
Thanks in advance.
Jacco
Hi
use Alt() fonction that allow to test different datetime timestamp format
hope it helps
if all your values have at least "yyyy-MM-dd'T'HH:mm:ss", why not
left(datetimevalue,21) and continue with that?
otherwise, somethging combining left(datetimevalue,28) & repeat('0',28-len(datetimevalue) )
(max length supposed to be 28... )
I suggest reading this field as a string type, then checking the length of the data and parsing the string data into a Date value using the corresponding date pattern on other component such as tJavaRow after ttExtractJSONFields.
Regards
Shicong
Try this
Alt(
Timestamp#([Timestamp], 'YYYY-MM-DDThh:mm:ss.SSSSSS'),
Timestamp#([Timestamp], 'YYYY-MM-DDThh:mm:ss')
) AS DateTime