the time module is useful for getting unix epoch timestamp to work with but if you want to display date in more convenient formator do arithmetic with dates (for examplefiguring out what date was days ago or what date is days from now)you should use the datetime module the datetime module has its own datetime data type datetime values represent specific moment in time enter the following into the interactive shellimport datetime datetime datetime now( datetime datetime( dt datetime datetime( dt yeardt monthdt day ( dt hourdt minutedt second ( calling datetime datetime now( returns datetime object for the current date and timeaccording to your computer' clock this object includes the yearmonthdayhourminutesecondand microsecond of the current moment you can also retrieve datetime object for specific moment by using the datetime datetime(function wpassing it integers representing the yearmonthdayhourand second of the moment you want these integers will be stored in the datetime object' yearmonthday xhourminuteand second attributes unix epoch timestamp can be converted to datetime object with the datetime datetime fromtimestamp(function the date and time of the datetime object will be converted for the local time zone enter the following into the interactive shellimport datetimetime datetime datetime fromtimestamp( datetime datetime( datetime datetime fromtimestamp(time time()datetime datetime( calling datetime datetime fromtimestamp(and passing it returns datetime object for the moment , , seconds after the unix epoch passing time time()the unix epoch timestamp for the current momentreturns datetime object for the current moment so the expressions datetime datetime now(and datetime datetime fromtimestamp(time time()do the same thingthey both give you datetime object for the present moment you can compare datetime objects with each other using comparison operators to find out which one precedes the other the later datetime object is the "greatervalue enter the following into the interactive shellu halloween datetime datetime( newyears datetime datetime( oct datetime datetime( keeping timescheduling tasksand launching programs