%c Local corresponding date representation and time representation
Day of the year in %j (001-366)
%p local AM or PM equivalent
%U Week of the year (00-53) Sunday is the start of the week
%w week (0-6), Sunday is the start of the week
%W Week of the year (00-53) Monday is the start of the week
%x local corresponding date representation
%X local corresponding time representation
%Z The name of the current time zone
%%% sign itself
#coding=utf-8
import time
#get timestamp
ticket=time.time()
print ticket
#Get current time
localtime=time.localtime(ticket)
print 'Current time:', localtime
#Format time
astime=time.asctime(localtime)
print astime
#custom format time
print time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())
#Uppercase is the full name, lowercase is the abbreviation
print time.strftime("%A-%B-%d %H:%M:%S",time.localtime())