Created attachment 373014 [details] Example Python script reproducing issue Hi all, I've been looking at invoice.GetDatePosted() for newly created invoices where the posted date hasn't been initialised and rather than returning None or 0000-00-00 00:00 they're returning very large invalid times. Please refer to the attachment which reproduces the issue printing an invalid date. I believe the issue is e.g. in gncInvoice.c invoice->date_posted is initialised to INT64_MAX which is sent though to Python as a datetime. My suggested fix is to update the time64.i to return Py_None if the time matches INT64_MAX and I've attached a patch which does this and rerunning the test script now prints 'None'. If you feel this is a reasonable solution I can submit a pull request if required. Kind regards, Tom
Created attachment 373015 [details] Proposed patch to resolve this issue
Comment on attachment 373015 [details] Proposed patch to resolve this issue Nah, it's a simple enough patch, I just pasted it in. It would be nice if next time you create a proper patch with `git format-patch`, though.