TimeStamp in ServerTasks file

I was looking to create a small process that would run nightly on the servertask files (located here [Drive]\Octopus\TaskLogs) that would simply scan the files for certain info my work wanted, but one of the things they want is some timing information (like a deployments time minus a manual pause time) and when I look at the logs the time is in this format:

2018-09-06T19:18:34.6673686+00:100:

Does anyone have a way to take this info and get the correct time because I have not been able to at this point.

Hi,

Thank you for your question!

The dates in the task logs are in the standard ISO 8601 date format which avoids any confusion about ordering or timezones. The date in your example is 7:18:34 PM on the 6th of September, 2018. However, your example does appear to be formatted incorrectly, as the timezone component (after the +) should read 00:00. I’ve checked my task logs and they have a correct timezone component. Would you mind double checking your task logs and perhaps reply with a small excerpt here so we can make sure they are correct?

You should be able to convert these ISO-format dates to any other format you want with most programming / scripting languages. For example, in C# you can use DateTime.Parse("2018-09-06T19:18:34.6673686+00:00") to read the date and from there do any calculations or formatting which you require.

Looking forward to hearing from you.

Regards,
Jayden

Thanks Jayden and it does look like I somehow pasted the wrong format as I just doubled checked my log and it does have this:

2018-09-06T19:18:34.6673686+00:100:

Thanks for the info I think this should get me over this issue.

Regards,
JP

Jayden,

I was able to get a simple test done and it worked, so once again thanks for your help.

Hi,

I’m glad you got it sorted. Let me know if we can assist with anything else!

Regards,
Jayden

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