Author Topic: Get Today’s Current Date and Time  (Read 557 times)

akash.datasoft

  • Green Belt
  • *****
  • Posts: 216
  • Karma: +0/-0
Get Today’s Current Date and Time
« on: October 06, 2013, 05:29:23 AM »
Get Today’s Current Date and Time


You can use time module (low level) which provides various time-related functions. However, this module is always available, not all functions are available on all platforms. Hence, you need to use the datetime (high level Object-oriented interface to dates and times) module in Python. It provides classes for manipulating dates and times in both simple and complex ways. While date and time arithmetic is supported, the focus of the implementation is on efficient attribute extraction for output formatting and manipulation.


The syntax is:

time.strftime(format)
## 24 hour format ##
time.strftime("%H:%M:%S")
## 12 hour format ##
time.strftime("%I:%M:%S")
 


thanks