Announcement

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

  • Calculation of Date

    I Imported data from ODK ONA database but am having trouble calculating the age of the respondent because the age am getting is a 11 digit number that looks like its in UNIX timestamp format. Anyone to help with code to convert it to normal time and calculate the age.
    Thanks
    Attached Files

  • #2
    The output of
    Code:
    help datetime_software
    includes a discussion of converting UNIX timestamps to Stata Internal Format datetime values.

    That discussion assumes a general knowledge of Stata's "date and time" variables If you have not already read the very detailed Chapter 24 (Working with dates and times) of the Stata User's Guide PDF, do so now. If you have, it's time for a refresher. After that, the help datetime documentation will usually be enough to point the way. You can't remember everything; even the most experienced users end up referring to the help datetime documentation or back to the manual for details. But at least you will get a good understanding of the basics and the underlying principles. An investment of time that will be amply repaid.

    All Stata manuals are included as PDFs in the Stata installation and are accessible from within Stata - for example, through the PDF Documentation section of Stata's Help menu.
    Last edited by William Lisowski; 18 Feb 2022, 13:47.

    Comment

    Working...
    X