You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with each of the three options having "ISO" by default if omitted.
This would also make syntax for custom formats possible, like dateTimeAs = c(time = "%H:%M"), which I would use, since that's the csv convention where I work.
The text was updated successfully, but these errors were encountered:
mattdowle
changed the title
[Request] in fread, set option dateTimeAs separately for date and time
[Request] in fwrite, set option dateTimeAs separately for date and time
Jan 25, 2017
Yes controlling the format per column like that is good idea and no problem.
Custom format is tricky to implement at C level that runs very fast, though. Full flexibility such as format() provides needs code inside it to navigate the format string. Doing that over and over again for each field is wasteful and one of the reasons fwrite is very fast.
Adding a small set (say less than 20) of specific custom formats would be ok. They would just be variations on a theme and easy to code in C. I'm thinking we should only allow sane ones which are ordered by descending datepart size; i.e., no American mm/dd/yyyy.
If that sounds ok .... can you or someone propose the list of formats to implement? They can still look like a custom format "%H:%M". If someone attempted "%M:%H" it would error that it wasn't in the predefined set. Do we need any formats that don't use : to separate timeparts and - to separate date parts?
What if you specify "%H:%M" but there are seconds present in the data - should it warn that you're losing precision? If no seconds are present, it could automatically drop the seconds. Like it already does with POSIXct and milliseconds.
If that sounds ok .... can you or someone propose the list of formats to implement?
%H:%M is the only one that comes to mind for me and, browsing around, I don't see any other common date or time formats. Maybe folks on the mailing list would have others.
jangorecki
changed the title
[Request] in fwrite, set option dateTimeAs separately for date and time
in fwrite, set option dateTimeAs separately for date and time
Apr 5, 2020
Perhaps some syntax like
with each of the three options having "ISO" by default if omitted.
This would also make syntax for custom formats possible, like
dateTimeAs = c(time = "%H:%M")
, which I would use, since that's the csv convention where I work.The text was updated successfully, but these errors were encountered: