You're currently browsing the Ignition 7.9 docs. Click here to view the latest docs.

The following feature is new in Ignition version 7.9.1
Click here to check out the other new features
This function is used in Python Scripting.


Attempts to parse a string and create a Date. Causes ParseException if the date dateString parameter is in an unrecognized format.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax, formatString, locale)

  • Parameters

String dateString - The string to parse into a date.

String formatString - Format string used by the parser. Default is "yyyy-MM-dd HH:mm:ss" [optional]

Object locale - Locale used for parsing. Can be the locale name such as 'fr', or the Java Locale such as 'Locale.French'. Default is 'Locale.English'. Click here for a list of supported locales and and values. [optional]

  • Returns

Date - The parsed date.

  • Scope


Code Examples
Code Snippet
# This example will return a date object set to the given date and time, May 28th, 1992 at 4:22am. 
print'May 28, 1992 4:22', 'MMMM dd, yyyy hh:mm')
Code Example - Using the Locale Parameter
# This example demonstrates the locale parameter to parse a French date
print"juillet 15, 2015 10:32:15", "MMMM dd, yyyy hh:mm:ss", "fr")
# If using the Java Locale, then you must import from the Locale class. The following example parses a German date.  
from java.util import Locale
print'21-Februar-2017 04:22:00', 'dd-MMMM-yyyy HH:mm:ss', Locale.GERMAN)
  • No labels