Lab #6: Date and Time

 

Today in lab we were able to manipulate strings using operations specific to strings only. Strings here were mostly used to so be outputted into the console. In a specific point, we were asked to make the console output the current date and time.

Before we can do any of those, we need to import the module that gives the current time.Capture

We checked what datetime.now() did, and it gave its own format of how the date should look likeCapture2

Then we printed the individual parts of what makes up a date and time.Capture3

Now we created the date format that most of us are used to which is month, day, then year. (We usually put the last two digits of year but for this case we print the whole year)Capture4

Next we printed the our format of time, its is still the same as how the module gave it but here we are getting rid of the unnecessary milliseconds.Capture5

Finally we put them together to make our version of date and time.Capture6