From: Robin Dunn Date: Sat, 9 Apr 2005 20:08:49 +0000 (+0000) Subject: Don't depend on the default formatting of wx.DateTime objects for X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c5d11c71d791122ec50379c15887898a4d49f1af Don't depend on the default formatting of wx.DateTime objects for extracting a date and time string. The format depends on locale and platform defaults. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/wx/lib/printout.py b/wxPython/wx/lib/printout.py index 1ca001d975..086a6c1fc0 100644 --- a/wxPython/wx/lib/printout.py +++ b/wxPython/wx/lib/printout.py @@ -173,10 +173,9 @@ class PrintBase: return date + ' ' + time def GetNow(self): - full = str(wx.DateTime_Now()) # get the current date and time in print format - flds = full.split() - date = flds[0] - time = flds[1] + now = wx.DateTime.Now() + date = now.FormatDate() + time = now.FormatTime() return date, time def SetPreview(self, preview):