This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_time(time): | |
return datetime.datetime.strptime(time, '%I:%M %p') | |
def total_time(): | |
t_in = get_time(raw_input("Please enter your start time in 00:00 format: ")) | |
t_out = get_time(raw_input("Please enter your end time in 00:00 format: ")) | |
delta = t_out - t_in | |
HOUR = 60 * 60 | |
delta_tenths = float(delta.seconds // (HOUR / 10)) / 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def time_formatter(): | |
""" | |
Takes user input as 00:00, splits those using : as seperator, | |
and prints the time formatted for timesheet in tenths of an | |
hour | |
""" | |
time_input = raw_input("\nTime Formatter\n" \ | |
"Please enter hours and minutes worked today" \ | |
"in 00:00 format: ") | |
if len(time_input.split(':')) == 2: |
NewerOlder