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

python: converting string to datetime format #32

Open
sophryu99 opened this issue Oct 27, 2021 · 0 comments
Open

python: converting string to datetime format #32

sophryu99 opened this issue Oct 27, 2021 · 0 comments
Labels

Comments

@sophryu99
Copy link
Owner

"15:30" to HH:MM format

# Check if within an hour
        def calcdiff(start, end):
            time_diff = datetime.datetime.strptime(end, '%H:%M') - datetime.datetime.strptime(start, '%H:%M')
            minutes = int(time_diff.total_seconds()/60)
            return minutes <= 60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant