Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python Exercise Example 91

Python Exercise Example 91

Python 100 Examples Python 100 Examples

**Problem:** Time function example 1.

**Analysis:** None.

Program source code:


#!/usr/bin/python
# -*- coding: UTF-8 -*-

if __name__ == '__main__':
    import time
    print time.ctime(time.time())
    print time.asctime(time.localtime(time.time()))
    print time.asctime(time.gmtime(time.time()))

The output of the above example is:


Wed Oct 21 17:08:51 2015
Wed Oct 21 17:08:51 2015
Wed Oct 21 09:08:51 2015

Python 100 Examples Python 100 Examples