Is there an inbuild DateTime functionality that could give me a string format of today's date as 2020-12-22T13:36:45 Etc/UTC (+00)
I can think of these ways:
var date = DateTime.Now;
var result = date.ToString("yyyy-MM-ddTHH:mm:ss") + " Etc/UTC (+00)";
Console.WriteLine(date.ToString("yyyy-MM-ddTHH:mm:ss Etc/UTC (+00)"));
//Gives '2020-12-23T10:59:59 EAc/UTC (+00)' - incorrect t replaced by A
Console.WriteLine(result);
//Gives '2020-12-23T10:59:59 Etc/UTC (+00)' Correct,
As you can see I can get the correct format, though I am not sure this is the best solution, as it looks very artificial.
Is there a better way to format the string?