Datetime stamp issue in Python logging: Goes to three years 2011 back

Hi,

I am having weird issue about datetime stamp in my python application log file running on Linux.

I am using the following format in my logging handler
log_format = logging.Formatter('%(asctime)s-%(levelname)s-%(message)s','%m:%d:%Y %H:%M:%S' )

For some reason: Datetime stamp goes to three years back to 2011 not current time. This happens usually when my python application is restarted by cron

I have no clue what is happening

Any thoughts/experiences - greatly appreciated

High Regards

BRE

Does the "date" linux command report the right date?

Thank you very much for the reply Federico,

My application runs in the background like a daemon, It is not possible to check the command line date from linux at that time.

From your reply, I infer, Python's date depends on the date from Linux ?

Regards

BRE

Suffices to run "date" on linux while your daemon is running. Python merely reports the system date: if that date is wrong, you get a wrong date
If system date is wrong, double check your yun can use the NTP protocol, which uses port 123 UDP: it allows yun's system clock to get synchronized

Super …

Thanks Federico

Will do as advised,

Regards,

BRE