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
I'd be expecting both results to print, 2024-10-09 00:00:00. The actual prints are,
2024-10-08 00:00:00 2024-10-09 00:00:00
this may be intended behaviour but it doesn't seem like it from my perspective.
Edit: Possibly this is user error, as using 'TO_TIMEZONE' : time_zone instead of TIMEZONE : time_zone seems to return the correct 12am for the tz_result variable. Although I'm a still little confused on why "TIMEZONE" was returning me the previous day's 12am since I've specified PREFER_DATES_FROM_FUTURE. If anyone knows why I'd love to hear it, thanks
The text was updated successfully, but these errors were encountered:
I was trying to reproduce the behavior observed by you, i.e. different output with the parameter provided & not provided, however, I couldn't do that.
At the same time, I think I discovered one of the possible bug. When we enter the value at 12 am , it is parsed with RELATIVE_TIME to be current time in UTC, while I think it should be RELATIVE TIME in the given TIMEZONE or the local timezone.
Here, the current time is 27/10/2024 1:19 AM Asia/Kolkata. The default parsing use the current time in UTC and hence date is picked as 26/10/2024.
If I apply the PREFER_DATES_FROM to future , the date is moved one day ahead, which is correct w.r.t the UTC timezone, but incorrect if I address my local timezone. It also doesn't respect the timezone provided in the settings and only apply it after parsing.
A solution to this would be to provide explicity RELATIVE_BASE to the settings with the datetime.now() value that would pick your local timezone value.
It's currently 08/10/2024 23:37 pm Europe/London time. Observe the following code,
I'd be expecting both results to print, 2024-10-09 00:00:00. The actual prints are,
2024-10-08 00:00:00
2024-10-09 00:00:00
this may be intended behaviour but it doesn't seem like it from my perspective.
Edit: Possibly this is user error, as using
'TO_TIMEZONE' : time_zone
instead ofTIMEZONE : time_zone
seems to return the correct 12am for thetz_result
variable. Although I'm a still little confused on why "TIMEZONE" was returning me the previous day's 12am since I've specified PREFER_DATES_FROM_FUTURE. If anyone knows why I'd love to hear it, thanksThe text was updated successfully, but these errors were encountered: