Sunday, 26 June 2016

Python time api

In this tutorial series I am going to explain about time, datetime, calendar api.

API
Description
time
Provide various time related functions
datetime
Provide classes for manipulating dates and times
calendar
Provides Calendar class used to output calendars like the Unix cal program.


      Python time api
      Calendar module
      Calendar class
             iterweekdays: Get week day numbers iterweekdays()
            itermonthdates(year, month)
            itermonthdays2(year, month)
             itermonthdays(year, month): Return day numbers for given month
            monthdatescalendar(year, month)
            monthdays2calendar(year, month)
            monthdayscalendar(year, month)
            yeardatescalendar(year, width=3)
            yeardays2calendar(year, width=3)
            yeardayscalendar(year, width=3)
      TextCalendar: Generate plain text calendars.
            formatmonth: Equivalent of UNIX cal command
            prmonth: Print months calendar
            formatyear: Return year formatted data
            pryear: print the calendar for entire year
      HTMLCalendar: Generate HTML calendars
            formatmonth: Get months calendar as html table
            formatyear: Get year calendar as html table
            formatyearpage: Get year data as html page
      LocaleTextCalendar: Get locale specific month and year
      Get locale specific calendar details in HTML form
      Check for leap year
      Get leap years in given range
      Get day of the week
      Get week day names
      monthrange: get number of days in month
      Get month calendar
      Get formatted month calendar
      Print month calendar
      get year calendar
      Print year calendar
      timegm: get UNIX time stamp value
      day_name: get day names of the week
      day_abbr: get abbreviated day names of the week
      month_name: Get month names
      Get abbreviated month names
      time module
            time.time(): Get current time
            time.strftime: Convert time values to string
            time.strptime: Convert string to stuct_time value
            time.gmtime: Convert seconds to struts_time tuple in UTC
            time.localtime : Convert seconds to struts_time tuple in local time
            time.mktime: Convert strut_time to local time
            time.process_time: Calculate system and cpu time time.process_time()
            time.monotonic(): Get monotonic time
            time.asctime([t]): Convert time to readable format



Previous                                                 Next                                                 Home

No comments:

Post a Comment