Files
Phoenix/docs/sphinx/rest_substitutions/snippets/python/converted/DateTime.ParseFormat.1.py
Andrea Gavana f97b2e4e6b Phoenix documentation:
* Added overviews for wx.FileSystem, wx.ToolBar and wx.DateTime (thanks to the wxWidgets docs);
* Converted many snippets from C++ to Python for wx.ToolBar, wx.DateTime and wx.TextEntry;
* Updated the conf.py file.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70889 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-12 21:03:35 +00:00

13 lines
380 B
Python

dt = wx.DateTime() # Uninitialized datetime
bDate = "25/12/2012"
if not dt.ParseFormat(bDate, "%d-%m-%Y"):
# This datetime format is wrong on purpose
print "Wrong format"
elif dt.ParseFormat(bDate, "%d/%m/%Y"):
# This is correct
print "Format OK!", dt