Convert text to date


I am using pre-populated data set and using a date that I want to calculate with current date

The pre-populated data set is in .csv format and date is in 'YYYY-MM-DD'. When I read from the pre-populated and display on the screen, I can see the correct display of the value, e.g. '2011-11-25'. I assume the date values are in text format which we need to convert to 'date' format.

I have used the command date(${field1}) to convert to date format and when the output it shows a blank field.

Can anyone suggest how to convert to date from a text.

Many thanks,

The date() function "Converts an integer representing a number of days from January 1, 1970 (the Unix Epoch) to a standard date value." See the docs on Converting dates and time.

Why do you need to convert to a date? See this thread for some info that may be useful: