How to return exact ISO 8601 date format

Hi Everyone!

I’m trying to use a custom sharepoint activity to retrieve a specific list item using a CAML Query to filter a datetime column. However, the CAML only accepts the datetime value in the ISO 8601 format or “yyyy-MM-ddThh:mm:ssZ”. The problem arises whenever I try to convert my period variable (“11/25/2020”) into the format above since it’s returning “yyyy-MM-dd hh:mm:ss” or “2020-11-25 12:00:00”

Here’s the expression that I used:

Convert.ToDateTime(in_Period).ToString(“yyyy-MM-ddThh:mm:ssZ”)

I’m looking for the expression to return a result in this exact format “2020-11-25T12:00:00Z” .

Thank you in advance!
Regards,

@MensenLijauco

Welcome to community

Check as below

Hope this helps you

Thanks

2 Likes

Thank you! This is very much appreciated. :slight_smile:

1 Like

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