How include date and time in a csv file handle
A colon terminates the device name (C:) thus your file name is invalid.
You can't have the character ":" in a file name. It is invalid. It is used for drive name (e.g. "C:\").
So you will have to use a different format for the time (e.g. "h" instead of ":", "20h34" instead of "20:34").
So once you have the Date and Time string, replace the ":" with "h".
string _datetime = TimeToString( TimeLocal() ); StringReplace( _datetime, ":", "h" ); string _filename = _datetime + " Result.csv";
You can't have the character ":" in a file name. It is invalid. It is used for drive name (e.g. "C:\").
So you will have to use a different format for the time (e.g. "h" instead of ":", "20h34" instead of "20:34").
So once you have the Date and Time string, replace the ":" with "h".
Hi All,
I hope somebody out there can help me.
I want to add the date and time to my csv file handle, so that my filename will be something like 2022.12.08 10:40 Result.csv
If I do this:-
My alert panel returns 2022.12.08 10:40 Result.csv which is what I expected.
However if I do this:-
the file isn't generated. If I don't try to include the date and time, all works perfectly well.
I've tried umpteen combinations, all to no avail.
Please help ...