Announcement

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

  • From %tcnn/dd/ccYY_hh:MM to %td

    Does anyone know how to get from a date (imported from excel)
    2/18/2012 3:56 to a stata date called 18feb2012?
    thank you
    Lars

  • #2
    under "help datetime", click on "sif-to-sif conversions" - the function you want is dofc (as shown in that part of the help file)

    Comment


    • #3
      ended up doing:
      Code:
       gen new_date = dofc(date)
        format new_date %td

      Comment


      • #4
        Note that "imported from Excel" means nothing here in itself. It covers everything from a string with that content to a formatted numeric date-time.

        Comment

        Working...
        X