Dear users,
I am utterly confused. I have a string variable "date" (example observation in "date" is "7jul2013 0:00:00"). When I convert the string into a new clocktime variable using:
gen datedate = clock(date, "DMYhms")
format datedate %tc
Stata returns: "06jul2013 23:59:37"
When I do:
gen datedate = clock(date, "DMYhms")
format datedate %tC
Stata returns: "06jul2013 23:59:12"
When I do:
gen datedate = Clock(date, "DMYhms")
format datedate %tc
Stata returns: "06jul2013 23:59:37" (like the "clock" function)
And when I do:
gen datedate = Clock(date, "DMYhms")
format datedate %tC
Stata returns: "06jul2013 23:59:12" again
What should I do to obtain the correct date and time. i.e., "7jul2013 0:00:00" as a %tc variable (instead of a string)?
I am utterly confused. I have a string variable "date" (example observation in "date" is "7jul2013 0:00:00"). When I convert the string into a new clocktime variable using:
gen datedate = clock(date, "DMYhms")
format datedate %tc
Stata returns: "06jul2013 23:59:37"
When I do:
gen datedate = clock(date, "DMYhms")
format datedate %tC
Stata returns: "06jul2013 23:59:12"
When I do:
gen datedate = Clock(date, "DMYhms")
format datedate %tc
Stata returns: "06jul2013 23:59:37" (like the "clock" function)
And when I do:
gen datedate = Clock(date, "DMYhms")
format datedate %tC
Stata returns: "06jul2013 23:59:12" again
What should I do to obtain the correct date and time. i.e., "7jul2013 0:00:00" as a %tc variable (instead of a string)?
Comment