Skip to content
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

Add format to Anytime() #127

Open
pollytatouin opened this issue May 2, 2023 · 0 comments
Open

Add format to Anytime() #127

pollytatouin opened this issue May 2, 2023 · 0 comments
Assignees

Comments

@pollytatouin
Copy link

Hi,

First of all, thank you for this incredibly useful package.

I had issues with some dates from a report returning as NA, and I traced it down to anytime() needing some additional formats in order to properly read the format used by salesforce (at least in my dataset). There is ambiguity.

I don't know if it's common to all salesforce datetime fields, but perhaps it's worth an adjustment if so ?

require(anytime)

date1 <- "07/12/2022 12:00 PM"
date2 <- "24/02/2022 12:00 PM"

anytime(date1, tz = "UTC", asUTC = T)
#> [1] "2022-07-12 UTC"
anytime(date2, tz = "UTC", asUTC = T)
#> [1] NA

addFormats("%d-%m-%Y %H:%M")
anytime(date2, tz = "UTC", asUTC = T)
#> [1] "2022-02-24 12:00:00 UTC"

Created on 2023-05-02 by the reprex package (v2.0.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants