- if wxdt.Format('%p') not in ('AM', 'PM') and checkTime in (5,8):
- # couldn't parse the AM/PM field
+ try:
+ if wxdt.Format('%p') not in ('AM', 'PM') and checkTime in (5,8):
+ # couldn't parse the AM/PM field
+ raise ValueError('cannot convert string "%s" to valid time for the current locale; please use 24hr time instead' % value)
+ else:
+ ## dbg(indent=0, suspend=0)
+ raise ValueError('cannot convert string "%s" to valid time' % value)
+ except: