Description i What is timestamp? Note that we have only timestamps, which ALWAYS contain yyyy-mm-dd as a date, hh:mm:ss as a time, and +/-zzzz as a timezone. time 2017-10-14 00:11:20 +0000 date time zone 12345 + timeconverter.py 1 def convert_time(timestamp): #NOTE: COMPLETE THE CODE FROM HERE! 6 #DO NOT MODIFY THE CONTENT HERE: 7 def print_result(hour, minute): 8 9 print("The time is {}:{}".format(hour, minute)) 10 #DO NOT MODIFY THE CONTENT HERE: 11 timestamp_list = ['2017-10-14 00:11:20 +0000', 12 '2022-03-24 07:22:16 -0400' Topic: Timestamp Converter Write a program timeconverter.py that has two functions: 1) The function convert_time : for extracting the hour and minute from a timestamp and 2) The function print_result: for printing the results. Note that the two functions should be called under the loop. 1) The function convert_time should: 1. take the timestamp from the function call, 2. separate time from date and time zone, 3. split it into hour, minute and seconds, 4. extract and returns only the hour and minute values (check lesson 1.3 how to use it) You need to complete the code to make the function convert_time works as above. 13 '2022-03-24 10:45:05 -0400' 14 '2020-06-18 12:38:55 -0200' , 15 '2003-12-24 18:00:30 +0800' , و 16 '2003-12-24 23:59:59 +0800'] 17 18 19 for timestamp in timestamp_list: 20 21 #NOTE: COMPLETE THE TWO FUNCTION CALLS FROM HERE! 2) The function print_result is already completed so you MUST not modify the code. The function: 1. takes the hour and minute values 2. prints hour and minute in hh:mm format. Then, under the provided for loop, you need to call those functions in order to print the sample output using the given timestamps timestamp_list. (NOTE: YOU MUST NOT change the provided timestamps). Your program should output the following. [user@sahara ~]$ python timeconverter.py The time is 00:11 The time is 07:22 The time is 10:45 The time is 12:38 The time is 18:00 The time is 23:59 You MUST use split(), print(), format() and perform the function calls on the given timestamps /home/timeconverter.py Spaces: 4 (Auto) Terminal

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter14: Introduction To Swing Components
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
Description
i
What is timestamp?
Note that we have only timestamps, which ALWAYS contain yyyy-mm-dd as a date, hh:mm:ss as a
time, and +/-zzzz as a timezone.
time
2017-10-14 00:11:20 +0000
date
time zone
12345
+
timeconverter.py
1 def convert_time(timestamp):
#NOTE: COMPLETE THE CODE FROM HERE!
6 #DO NOT MODIFY THE CONTENT HERE:
7 def print_result(hour, minute):
8
9
print("The time is {}:{}".format(hour, minute))
10 #DO NOT MODIFY THE CONTENT HERE:
11 timestamp_list = ['2017-10-14 00:11:20 +0000',
12 '2022-03-24 07:22:16 -0400'
Topic: Timestamp Converter
Write a program timeconverter.py that has two functions: 1) The function convert_time :
for extracting the hour and minute from a timestamp and 2) The function print_result: for
printing the results.
Note that the two functions should be called under the loop.
1) The function convert_time should:
1. take the timestamp from the function call,
2. separate time from date and time zone,
3. split it into hour, minute and seconds,
4. extract and returns only the hour and minute values (check lesson 1.3 how to use
it)
You need to complete the code to make the function convert_time works as above.
13 '2022-03-24 10:45:05 -0400'
14 '2020-06-18 12:38:55 -0200' ,
15 '2003-12-24 18:00:30 +0800' ,
و
16 '2003-12-24 23:59:59 +0800']
17
18
19 for timestamp in timestamp_list:
20
21
#NOTE: COMPLETE THE TWO FUNCTION CALLS FROM HERE!
2) The function print_result is already completed so you MUST not modify the code. The
function:
1. takes the hour and minute values
2. prints hour and minute in hh:mm format.
Then, under the provided for loop, you need to call those functions in order to print the
sample output using the given timestamps timestamp_list. (NOTE: YOU MUST NOT change
the provided timestamps).
Your program should output the following.
[user@sahara ~]$ python timeconverter.py
The time is 00:11
The time is 07:22
The time is 10:45
The time is 12:38
The time is 18:00
The time is 23:59
You MUST use split(), print(), format() and perform the function calls on the given
timestamps
/home/timeconverter.py Spaces: 4 (Auto)
Terminal
Transcribed Image Text:Description i What is timestamp? Note that we have only timestamps, which ALWAYS contain yyyy-mm-dd as a date, hh:mm:ss as a time, and +/-zzzz as a timezone. time 2017-10-14 00:11:20 +0000 date time zone 12345 + timeconverter.py 1 def convert_time(timestamp): #NOTE: COMPLETE THE CODE FROM HERE! 6 #DO NOT MODIFY THE CONTENT HERE: 7 def print_result(hour, minute): 8 9 print("The time is {}:{}".format(hour, minute)) 10 #DO NOT MODIFY THE CONTENT HERE: 11 timestamp_list = ['2017-10-14 00:11:20 +0000', 12 '2022-03-24 07:22:16 -0400' Topic: Timestamp Converter Write a program timeconverter.py that has two functions: 1) The function convert_time : for extracting the hour and minute from a timestamp and 2) The function print_result: for printing the results. Note that the two functions should be called under the loop. 1) The function convert_time should: 1. take the timestamp from the function call, 2. separate time from date and time zone, 3. split it into hour, minute and seconds, 4. extract and returns only the hour and minute values (check lesson 1.3 how to use it) You need to complete the code to make the function convert_time works as above. 13 '2022-03-24 10:45:05 -0400' 14 '2020-06-18 12:38:55 -0200' , 15 '2003-12-24 18:00:30 +0800' , و 16 '2003-12-24 23:59:59 +0800'] 17 18 19 for timestamp in timestamp_list: 20 21 #NOTE: COMPLETE THE TWO FUNCTION CALLS FROM HERE! 2) The function print_result is already completed so you MUST not modify the code. The function: 1. takes the hour and minute values 2. prints hour and minute in hh:mm format. Then, under the provided for loop, you need to call those functions in order to print the sample output using the given timestamps timestamp_list. (NOTE: YOU MUST NOT change the provided timestamps). Your program should output the following. [user@sahara ~]$ python timeconverter.py The time is 00:11 The time is 07:22 The time is 10:45 The time is 12:38 The time is 18:00 The time is 23:59 You MUST use split(), print(), format() and perform the function calls on the given timestamps /home/timeconverter.py Spaces: 4 (Auto) Terminal
Expert Solution
steps

Step by step

Solved in 1 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT