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 parse bug #413

Open
t1a2l opened this issue Dec 12, 2023 · 2 comments
Open

Date parse bug #413

t1a2l opened this issue Dec 12, 2023 · 2 comments

Comments

@t1a2l
Copy link

t1a2l commented Dec 12, 2023

when the parse function gets a date string it parse it incorrectly.

for example if i have the string "2023-12-11" - it will be converted as 11/12/2023 02:00:00

the issue is instead of a 00:00:00 time i get 02:00:00, and i don't understand why.

@wdavidw
Copy link
Member

wdavidw commented Dec 12, 2023

Please refer to the cast_date documentation which states that the option use the Date.parse function. It is implemented here.

My guess, it is the same date, just the timezone is different. I invite you to provide a 3-4 lines example to get further help.

@t1a2l
Copy link
Author

t1a2l commented Dec 14, 2023

@wdavidw It is connected to the time zone, can you maybe add an option that if cast_date is true, i can maybe a timezone option so i get the correct result?
Date.parse("2023-12-11") -> Mon Dec 11 2023 02:00:00 GMT+0200
Date.parse("2023-12-11 GMT+2") -> Mon Dec 11 2023 00:00:00 GMT+0200

I am getting a date string from csv and i want to parse it in local time. why not use moment or soemthing like that instead?

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