What is the correct way to parse DateTime on a server side onAfterGet event?
Hi everyone.
I'm currently trying to evaluate the current date and a date property however, when I try do parse the string provided by getProperty, it gives me the error:
String was not recognized as a valid DateTime.
I can confirm the property is of the Type: Date and Pattern: Short Date.
My relevant code:
[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:5ea4aa05-9cf8-4f39-aaab-d8f235e33c77:type=text&text=for%20%28int%20i%20%3D%200%3B%20i%20%3C%20this.getItemCount%28%29%3B%20i%2B%2B%29%0D%0A%7B%0D%0A%20%20%20%20Item%20thisItem%20%3D%20this.getItemByIndex%28i%29%3B%0D%0A%20%20%20%20%0D%0A%20%20%20%20string%20dateStr1%20%3D%20thisItem.getProperty%28%22_calibrated_next%22%2C%22%22%29%3B%0D%0A%20%20%20%20DateTime%20date1%20%3D%20DateTime.Parse%28dateStr1%29%3B%0D%0A%7D]
The only thing that I can think of that may cause this error is the date format conversion when localized from neutral UTC, but I couldn't find much in the Aras documentation related to this.
Thanks
So, strange enough, we had to restart the server machine and it worked flawlessly after that.
Anyway, thanks for your help once again.