Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: st: RE: Converting date/clock format to date format?


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   AW: st: RE: Converting date/clock format to date format?
Date   Mon, 20 Jul 2009 15:40:12 +0200

<> 


"How does one know what format was used"

You can use -ds- which has a -format- option so you can have Stata display
all variables -format-ted in a certain way.



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Miranda Kim
Gesendet: Montag, 20. Juli 2009 15:33
An: statalist@hsphsun2.harvard.edu
Betreff: Re: st: RE: Converting date/clock format to date format?

Thanks a lot for this. I also have some date variables that do not have 
any format and are stored as 'long'. How does one know what format was 
used and how to convert them in this case? Would one need to try all 
possible cases?
Thanks for your help

Nick Cox wrote:
> You are correct. This is a basic question that can be answered by
> reading the help. In addition to Martin Weiss' answers, the function
> -dofc()- may be what you need. 
>
> Nick 
> n.j.cox@durham.ac.uk 
>
> Miranda Kim
>
> I want to merge two datasets together that both have a 'datereturn' 
> variable.
> They have different formats however. In one it is a %tc and in the other
>
> %dD_m_Y.
> Where it is %tc format I cannot convert it to a date format...
> If I type
> format datereturn %dD_m_Y
> It displays: 1478563200000
> I know this is probably very basic, bu I'd be very grateful for some
> help...
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
>
>   

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index