Undefined error: 'None' has no attribute 'strftime'

I used frappe.utils.get_datetime(doc.reference_date).strftime(“%Y-%m-%d”) to fetch and format the date in print format but it returns an error.

Before this, the script is working fine but now, it’s suddenly it’s not working.

I’m seeing this issue as well. It appears to be a bug of some sort in the safe_exec environment.

does doc.reference_date return anything?