-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing a day of month not zero padded #1355
Comments
I'm adding a note, not useful for you. This works using Miller 5.
|
I did think my way around the problem in the end but required a bit of a lateral approach:
Specifically handles the fact my dodgy dates are 1 character shorter than the rest and then leftpad it with a 0 when it is... Not elegant but definitely does the job for the use case I outlined. |
Dear @johnkerl is this a bug? If I run this in Miller 6
I have
|
@aborruso |
I just hit this issue where both month and day could be single digits, and worked around it with gsub. Posting here in case this is useful to anyone else reading this thread.
gives
|
I'm trying to parse a date and reformat it into something a little bit more workable. Unfortunately I can't change the source system this gets exported from.
Example dates:
1/07/2022
22/10/2022
Day of month is the first value.
I'm using this
strptime
to parse the date:t = strptime($created_date, "%d/%m/%Y")
For
22/10/2022
this parses fine and then I can then uset
instrftime
to output the format I need. Unfortunately1/07/2022
doesn't work and results in(error)
. I understand the reason as the library providingstrptime
expects the%d
to be a zero-padded value (as it also does for%m
- and which happens to be true in this case).What I'd like to know though is whether there's a way to be able to fix my date so that
strptime
might be able to interpret it?The text was updated successfully, but these errors were encountered: