Announcement

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

  • Convering to workable date format

    Hi all,

    In the data I am using, I generally have dates in string variables with the format DD/MM/YEAR e.g. 14/08/2014. In this case, it is very easy to convert to a workable float/numeric format using
    Code:
    gen datevariable=date(relevantdate, "DMY")
    However, I have just come across a date variable in string format that looks like "21-Jun-06". I am having trouble figuring out how to convert this to a format similar to the above.

    Can anyone please help me with this issue?

    Thank you very much!

  • #2
    try this:
    Code:
    gen date2=daily(date,"DM20Y")
    note that this assumes that all years start "20"

    Comment

    Working...
    X