This function converts a text with a certain format into a timestamp.


stringToDate(text, timeZone) #Output: Number



Parser ExpressionDescription


stringToDate(%{issue.cf10002}, LOCAL)


This example will convert a text containing date information into a valid timestamp.





Parameters used in this function

ParameterInput (data type)Description
text

The parameter must contain data in a specific format. Usually this value is retrieved from a field.

Valid input string formats are: 

  • yyyy/MM/dd HH:mm
  • yyyy-MM-dd HH:mm
  • yyyy/MM/dd, yyyy-MM-dd,

Also formats relative to the current time like in JQL queries: "w" (weeks), "d" (days), "h" (hours) or "m" (minutes), or formats defined at system property jira.date.time.picker.java.format are valid.


timeZone

The time zone used for the calculation. 


Days might depend on the time zone - it might be Sunday on the west coast of the US while at the same time it's already Monday in Australia. 



This function returns a




Variant where you can manually define the date-time pattern. Read more about date-time patterns.


stringToDate(text, dateTimePattern ) #Output: Number



Parser expressionDescription


stringToDate("2020.03.25 at 11:30:00", "yyyy.MM.dd 'at' HH:mm:ss")


This example returns a timestamp representing a date-time value.




Parameters used in this function

ParameterInput (data type)Description
text

The parameter must contain data in a specific format. Usually this value is retrieved from a field.
dateTimePattern

Manually defined date-time pattern. Read more about date-time patterns.



This function returns a




Variant where you can additionally define a language and a country


stringToDate(text, dateTimePattern, language, country ) #Output: Number



Parser expressionDescription


stringToDate("Dec 7, 2020 2:10:25 AM PST", "MMM d, yyyy h:mm:ss a z", "eng", "US")


This example returns a timestamp based on the parameters provided.



Parameters used in this function

ParameterInput (data type)Description
text

The parameter must contain data in a specific format. Usually this value is retrieved from a field.
dateTimePattern

Manually defined date-time pattern. Read more about date-time patterns.

language

Define the language for the conversion. Valid input parameters can be found here: ISO 639-2
country

Define the country for the conversion. Valid input parameters can be found here: ISO 3166 alpha-2



This function returns a


This function is mostly used when you want to write the output into a Jira date-time picker.

If you want to convert a date into a text you might want to have a look at the function dateToString().



Use cases and examples



Parser function cloudstringToDate()
Map(tick)
Notes






Status
Tech review

Style guide




Short description

Converts a text into a date.

Output

Available since

Label