In this program our task is to create a program in python which will extract seconds from a given timestamp. We will use the
s attribute of the DataTime object to extract the second.
Example : If we have a data frame that contains 5 different time stamps such as:
Timestamp 2012-12-11 04:12:01 2013-10-13 04:12:04 2014-12-14 04:12:05 2015-11-15 04:12:06 2016-10-15 04:12:07
And our task is to extract that seconds from given timestamps. So the output here will be:
seconds 1 4 5 6 7
Example 1 :
Example 2 :
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.