I did this and think it'll work..
token=FileReadString(fileHandle); year=StringSubstr(token,0,4); month=StringSubstr(token,4,2); day=StringSubstr(token,6,2); time=StringSubstr(token,9,5); newsTime=StrToTime(StringConcatenate(year,".",month,".",day," ",time));
brad: I have a csv file that looks like this: 20140103 14:30:00 20140106 10:00:00 20140106 17:30:00 FileReadDateTime() "Reads from the file of CSV type a string of one of the formats: "YYYY.MM.DD HH:MI:SS" | Since it wants YYYY<DOT>MM<DOT>DD and you are giving it 20140103 (no dots,) why would do you expect it to work? |
Thanks.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi there,
Your assistance is appreciated, thanks.
I have a csv file that looks like this:
FileReadDateTime() "Reads from the file of CSV type a string of one of the formats: "YYYY.MM.DD HH:MI:SS", "YYYY.MM.DD" or "HH:MI:SS" - and converts it into a value of datetime type."
My code reads the first line and converts it to "2014.07.08 14:30:00" instead of "2014.01.03 14:30:00".
Here is the code:
Can you please advise?
Thanks,
Brad.