-
-
Notifications
You must be signed in to change notification settings - Fork 663
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
Error in datediff calculation #1106
Comments
seems to be correct, the timezones differ by 2 hours, which makes up in the resulting time difference. try specifying the timezones explicitly for now(), as it uses the local timezone, or switch to using utcnow(). |
Hi, ok, I replaced the tzinfo for start to "Europe/Berlin". But that has no effect
Start-Datetime: 2022-04-30T12:22:02.977434+02:00 The correct Time-Difference should be 00:37:57...... |
@Gravitar64 start and end are still in different timezones, you need to specify it for both of them. |
If i calculate the time difference between 2 datetime objects, the result is incorrect. Here an example:
import arrow
start = arrow.get('28.04.2022 14:00','DD.MM.YYYY HH:mm' )
end = arrow.now()
print(f'Start-Datetime: {start}')
print(f'End-Datetime : {end}')
print(f'Time-Difference: {end-start}')
Start-Datetime: 2022-04-28T14:00:00+00:00
End-Datetime : 2022-04-28T16:17:06.144073+02:00
Time-Difference: 0:17:06.144073
The correct Time-Difference should be 2:17:06......
System Info
The text was updated successfully, but these errors were encountered: