Announcement

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

  • Date

    Hi, How do I get to date in dd/mm/yyyy format?
    For example: 03/01/2011
    Thanks!

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input str19 date
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    "2011-01-03 00:00:00"
    end

  • #2
    Code:
    gen wanted = dofc(clock(date, "YMDhms"))
    format wanted %tdDD/NN/CCYY
    Note: I am assuming that the 01-03 part of your data refers to 3 January, not 1 March. If that's wrong, then it should be "YDMhms" in the second argument of clock().

    Comment


    • #3
      Thank you!

      Comment

      Working...
      X