- How to convert a string to a date in Stata?
- How do I convert a string to a date?
- How to convert date variable in Stata?
How to convert a string to a date in Stata?
Converting dates stored as strings to Stata dates
The string to be converted with clock(), Clock(), and date() may contain dates and times that are run together or include punctuation marks between the components.
How do I convert a string to a date?
Convert a String to a datetime object using datetime.strptime() The datetime.strptime() method returns a datetime object that matches the date_string parsed by the format. Both arguments are required and must be strings.
How to convert date variable in Stata?
To convert such dates to Stata dates, use the mdy function. It takes three numeric arguments: the month, day and year to be converted.