Date time format help

I want to write the current datetime in the following format “2018-02-22T10:00:00.837Z”

How can I do that?

1 Like

Hey @Krithi1

Please find the below statement…

Now.ToString("yyyy-MM-ddTHH:mm:ss.fffZ")

Thanks
#nK

Hi! @Krithi1,

Have a view on this thread!

Your Requirement solution!

Now.ToString("yyyy-MM-ddTHH:mm:ss.fffZ")

Date

Regards,
NaNi

Hi,

If you need not current local time but current UTC time, the following will work.

DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ")

Regards,

1 Like

thank you all.

1 Like

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