--- title: "system.date.parse" description: "Attempts to parse a string and create a Date." --- # system.date.parse > Attempts to parse a string and create a Date. This function is used in **Python Scripting**. ## Description 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](ignition-modules\vision\vision-project-properties\vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax `system.date.parse(dateString, [formatString], [locale])` ### Parameters Type | Parameter | Description ------- | ------- | ------ 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" Refer to [Data Type Formatting Reference](appendix\reference-pages\data-type-formatting-reference\data-type-formatting-reference.md). [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'. Refer to [Java Locale](http://www.oracle.com/technetwork/java/javase/java8locales-2095355.html). [optional] ### Returns **Date** - The parsed date. ### Scope Gateway, Vision Client, Perspective Session ## Code Examples ```python title="Code Snippet" # This example will return a date object set to the given date and time, May 28th, 1992 at 4:22am. print system.date.parse('May 28, 1992 4:22', 'MMMM dd, yyyy hh:mm') ``` ```python title="Code Snippet - Using the Locale Parameter" # This example demonstrates the locale parameter to parse a French date print system.date.parse("juillet 15, 2015 10:32:15", "MMMM dd, yyyy hh:mm:ss", "fr") ``` ``` python title="Code Snippet - Using the Java Locale" # This example demonstrates using the Java Locale. 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 system.date.parse('21-Februar-2017 04:22:00', 'dd-MMMM-yyyy HH:mm:ss', Locale.GERMAN) ```