Datetime fileread error: returning 1970 date instead of actual on file.

Back to topics list  | 1 2 To post a new topic, please log in or register
avatar
126
Demos 2015.08.31 01:14 #
 

Hello,

Since the string reads correctly, it is obvious that the problem lies in the sequence of MM and DD in your file, as stated earlier, which sequence can cause the conversion to DT to fail (as it does in your case). Your file is in the format YYYY.DD.MM, while the conversion function expects YYYY.MM.DD (MM to be before DD). You will not see it every time, since you could have 2015.05.05 which is valid in both cases, but the problem is still there 

As such, you have to write code to convert the data you are reading from the file OR

it may be easier to tell us how did you end up with such a format of DT in your file, it sure looks like a locale "issue" 

 

best regards

avatar
17
Vlaser91 2015.08.31 14:26 #
 
Demos:

Hello,

Since the string reads correctly, it is obvious that the problem lies in the sequence of MM and DD in your file, as stated earlier, which sequence can cause the conversion to DT to fail (as it does in your case). Your file is in the format YYYY.DD.MM, while the conversion function expects YYYY.MM.DD (MM to be before DD). You will not see it every time, since you could have 2015.05.05 which is valid in both cases, but the problem is still there 

As such, you have to write code to convert the data you are reading from the file OR

it may be easier to tell us how did you end up with such a format of DT in your file, it sure looks like a locale "issue" 

 

best regards

Thank you very much Demos for being observant. Issue solved.
Back to topics list   | 1 2  

To add comments, please log in or register