Docs.bmc.com will undergo a brief maintenance outage 27 March 2025. The site will be unavailable for ten minutes starting at 6:30 AM CDT/5 PM IST.

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:

Format

Description

dmy1

European date parser (dd.mm.yyyy)

ymd3

US style ISO date parser (yyyy/mm/dd)

mdy1

US date parser (mm/dd/yyyy)

mdy2

Alternative US date parser (mm-dd-yyyy)

ymd1

ISO date parser (yyyy-mm-dd)

ymd2

Alternative ISO date parser (yyyymmdd)

dmy2

Alternative European date parser 1 (dd/mm/yyyy)

dmy3

Alternative European date parser 2 (dd-mm-yyyy)

lit1

Literal date parser (day, month order)

lit2

Alternative literal date parser (month, day order)

unknown

No date part was found, defaultdate was used

If the passed date string cannot be parsed, time.parseLocal simply returns the the current date.