Can I change the date format from (YYYY, MM, DD) to (DD, MM, YYYY).
import datetime date_value = 41381.0 date_conv= datetime.date(1900, 1, 1) + datetime.timedelta(int(date_value)) print date_conv
conclusion:
date_conv = 2013-04-19
Convert python date formats - Unusual date formats - Extract% Y% M% D
The current output is in the (YYYY, MM, DD) formate.
>>> import datetime >>> date_value = 41381.0 >>> date_conv= datetime.date(1900, 1, 1) + datetime.timedelta(int(date_value)) >>> print date_conv.strftime('%d-%m-%Y') 19-04-2013
print date_conv.strftime('%d.%m.%Y')
prints the date in format DD.MM.YYYY. More formatting options here .
DD.MM.YYYY