Page 1 of 1

Time Formatting? Convet to text

Posted: 08 Jul 2014, 17:25
by shermanpat
I am trying to format some time stamps received from an API via JSON and the convert to text node doesn't seem to be able to format the date the direction i need.

The received time format look like this "2014-03-11T23:03:35.000Z" which looks to be Round-trip date/time pattern. I see in the ventuz help how to change to that format but not go from that format to a more read able format.


Can i use the convert to text node to get this reformatted?
How do I set it to local time?
Do I need to us C# to convert?

Thanks!

Re: Time Formatting? Convet to text

Posted: 10 Jul 2014, 10:16
by Daniel Willer
Hi there

Unfortunately you cannot but you can use a string expression to this.
date is the string input argument.

Code: Select all

System.DateTime.Parse(date).ToLocalTime().ToString("mm:ss")

Re: Time Formatting? Convet to text

Posted: 10 Jul 2014, 19:32
by shermanpat
Thank you, works great.

I ended up using this to get the full date to output date format I wanted.

Code: Select all

System.DateTime.Parse(A).ToLocalTime().ToString("U")