Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to convert the date to a readable format?

    Dear Stata users'

    I am dealing with data of the 10-X header data, one of the variables is fye, which means the fiscal year end. The data format is string and I think it is in the elapsed data form.
    I would be appreciate if anyone could help me to convert the data into a readable format.

    Thank you in advance.

    here's the example of the data
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long cik int f_year str4 fye
     70415 1994 "1231"
     40518 1994 "0930"
     30547 1994 "1025"
     70415 1994 "1231"
     15615 1994 "0430"
    716714 1994 "0930"
    350920 1994 "0930"
     51296 1994 "1031"
    758004 1994 "1031"
    808450 1994 "1031"
     96935 1994 "1231"
    830735 1994 "0930"
    102379 1994 "1031"
     30099 1994 "1031"
    315189 1994 "1031"
     37748 1994 "1031"
     40493 1994 "1031"
    711404 1994 "1031"
    850143 1994 "1231"
     33619 1994 "1031"
     77943 1994 "1031"
     86103 1994 "1031"
    711404 1994 "1031"
     86103 1994 "1031"
     31986 1994 "1231"
    771950 1994 "1130"
    791269 1994 "1231"
    738339 1994 "1231"
     15615 1994 "0430"
    766421 1994 "1231"
    end












  • #2
    Assuming it's in 'mmdd' format (that is, month followed by day, two digits each), which looks plausible:

    Code:
    gen fye_date=date(string(f_year)+fye,"YMD")
    format %td fye_date

    Comment

    Working...
    X