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

DATE not parsing rfc3339 correctly #720

Closed
fundef1 opened this issue Dec 31, 2021 · 1 comment · Fixed by #721
Closed

DATE not parsing rfc3339 correctly #720

fundef1 opened this issue Dec 31, 2021 · 1 comment · Fixed by #721

Comments

@fundef1
Copy link

fundef1 commented Dec 31, 2021

Describe the bug
DATE not parsing rfc3339 string correctly
2

To Reproduce
in https://www.montferret.dev/try/

LET dateString = "2021-08-29"
LET dateTime = DATE(dateString)
return dateTime

Expected behavior
a dateTime object, rfc3339 allows YYYY-MM-DD as a valid datetime string
at least according to ​https://ijmacd.github.io/rfc3339-iso8601/
although I guess you could argue that it's a full-date and not a date-time.

anyway some easier way of converting date(time) strings into datetime would come in handy

Screenshots

"error": "run program: parsing time \"2021-08-29\" as \"2006-01-02T15:04:05Z07:00\": cannot parse \"\" as \"T\": DATE(dateString) at 5:15"

Additional context
manually adding the remainder of an rfc3339 datetime works around the issue,

LET dateString = "2021-08-29"
LET dateStringFixed = CONCAT(dateString,"T00:00:00.00Z")
LET dateTime = DATE(dateStringFixed)
   ​T::DATETIME(dateTime)
return dateTime
``
@ziflex
Copy link
Member

ziflex commented Jan 3, 2022

Well, this part is handled by Go's standard library.
I guess the most suitable fix would be to allow passing an alternative string layout to the function.

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

Successfully merging a pull request may close this issue.

2 participants