Hello Dojo Community !
I'm currently working on a C# script where I need to parse a string into a DateTime object. I've tried using DateTime.TryParseExact
with multiple date formats, but I'm facing issues identifying the correct format.
Code snippet :
LastRestart format on the cube (table) UI:
LastRestart value from the streamviwer :
Despite trying various formats, I'm still encountering issues with certain date strings. I am not sure if the format is the one observed in the table (UI) or the one from seen from the stream viewer (loggs). I'm looking for suggestions or guidance on how to dynamically identify the correct DateTime format from a given string.
Any help, insights, or alternative approaches to accomplish this task would be greatly appreciated!
Thank you in advance for your assistance.
Hi Floris ,
Thank you for your suggestion , I am modifying the script to look into it and testing it out to observe results.
The current protocol snippet that shows the Date time :
with my script I would want collect datetime information using Getparameter method, then perform some calculation. But the formats options I had seemed to provide was not able to identify that parameter.
NB: reply to the previous answer does not allow me to post the screenshot, so i have added as a new answer .
Hi,
If you want to convert the value from that parameter to DateTime you should use DateTime.FromOADate instead of DataTime.TryParseExact.
DateTime.TryParseExact is when you have a string representation of a date, but in this case you have an OLE Automation date.