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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education