Case 1: From String to Stata format

This blog post discusses the conversion of text into Stata date. Once you have read this post, then you can read another post that lists a quick table of dates conversions from one frequency to another. Usually, when we import data manually into the Stata Editor, the dates are shown in string format. For example, Nov202011, November202011, or  etc. We can use the gen command with date function

gen newdate = date(oldDate, "MDY")

Case 2: From daily to monthly

gen monthly = mofd(daily_date)

Case 3: From daily to weekly

gen monthly = wofd(daily_date)

Case 4: From daily to quarterly

gen monthly = qofd(daily_date)

Case 5: From daily to yearly

gen monthly = year(daily_date)

Case 6: From monthly to daily

If our date is recorded in monthly numeric format such as 2001m1, 2001m2, etc, then:

gen daily = dofm(monthly_date)