I need to convert a text that is in ISO 8601 Date format, to DateTime in DataStudio. When the text comes with the hour and timezone parts having non-zero values, it works normally.
Code to convert: DATETIME_ADD(PARSE_DATETIME("%FT%R:%E3S",LEFT_TEXT(CreatedOn,23)), INTERVAL 11-CAST(SUBSTR(CreatedOn,24,3) as INT64) HOUR)
But when the hour and timezone parts come as zero, the conversion becomes null:
Code to convert: DATETIME_ADD(PARSE_DATETIME("%FT%R:%E3S",LEFT_TEXT(BGInvoiceDate,23)), INTERVAL 11-CAST(SUBSTR(BGInvoiceDate,24,3) as INT64) HOUR)