#!/usr/bin/python
import datetime
now = datetime.datetime.now()
print now
Result:
2013-08-03 01:32:27.711721
Para formatear la salida de la fecha:
import time
datetime.datetime.now().strftime('%d/%m/%Y')
Ref.:
http://www.pythonforbeginners.com/basics/python-datetime-time-examples/
http://www.tutorialspoint.com/python/time_strftime.htm
No hay comentarios:
Publicar un comentario