This documentation supports the 11.2 version of BMC Discovery.

To view an earlier version of the product, select the version from the Product version menu.

time.parseLocal

time.parseLocal(string)


Converts a string representing a local time into an internal UTC datetime object. If no time zone is present in the string it will use the time zone of the appliance.A wide range of date formats are supported including:

European formats

  • dd.mm.yyyy
  • dd/mm/yyyy
  • dd-mm-yyyy

US formats

  • mm/dd/yyyy
  • mm-dd-yyyy

ISO formats

  • yyyy/mm/dd
  • yyyy-mm-dd
  • yyyymmdd

Literal formats

  • day, month, year
  • month, day, year


Additionally, the following formats are supported and they are tried in order to find the first match:

FormatDescription
dmy1European date parser (dd.mm.yyyy)
ymd3US style ISO date parser (yyyy/mm/dd)
mdy1US date parser (mm/dd/yyyy)
mdy2Alternative US date parser (mm-dd-yyyy)
ymd1ISO date parser (yyyy-mm-dd)
ymd2Alternative ISO date parser (yyyymmdd)
dmy2Alternative European date parser 1 (dd/mm/yyyy)
dmy3Alternative European date parser 2 (dd-mm-yyyy)
lit1Literal date parser (day, month order)
lit2Alternative literal date parser (month, day order)
unknownNo date part was found, defaultdate was used
Was this page helpful? Yes No Submitting... Thank you

Comments