0

I have a requirement to parameter the time stamp in my SOAP Request below. I'm planning to write custom code in C# for the same.

Could you please help on the same.

<timeStamp>2017-11-11T03:52:26.464-06:00</timeStamp>
VISHVAMBRUTH J T
  • 602
  • 4
  • 14
  • 29

1 Answers1

1

If your question is how to check and transoform the XML value to something in C# this is would work:

var input = "2017-11-10T16:46:55.711-06:00";
var ok = DateTimeOffset.TryParse(input, out var parsed);
Console.WriteLine(ok ? parsed.ToString() : "Invalid");

and to write it back formatted:

Console.WriteLine(parsed.ToString("dd.MM.yyyy\\THH:mm:ss zzz"));
Alexander Schmidt
  • 5,631
  • 4
  • 39
  • 79