Skip to content

python: converting string to datetime format #32

Open
@sophryu99

Description

@sophryu99

"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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions