Different programming language support to find current date and time by different methods. For Python you can import datetime function from datetime module to get the date and time and further breakup.

Try the below statements to get Year, Month, Day, Hour, Minutes, Second and Microsecond-


The above example is not NOT correct. It appears correct if you compare with output shown on right side.

Actually when microsecond is like 078058, it will miss out printing 0.

Make sure to add padding for 6 digits as shown below. The function returns 6 digits in microsecond.