Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Add 15 days to a mm/yyyy


From   "Eva Poen" <eva.poen@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Add 15 days to a mm/yyyy
Date   Thu, 10 Apr 2008 15:22:38 +0100

Hi STATA Dndee,

what didn't you like about Nick's answer? He gave you the line
-gen var1n = date("15/" + var1, "DMY")-
to achieve your goal in Stata 10. For earlier versions of Stata, it
would be "dmy", I believe. Add
-format var1n %td-
to format the new date variable as a date (i.e. 15jun2005), since you
probably don't want to see 16602 in your output. All of this is well
explained in the help files and manuals.

Regards,
Eva

2008/4/10, STATA Dndee <statadndee@yahoo.co.uk>:
> Hi
>  I haven't received answer to my previous question.
>  Could anyone please help me with one of the questions?
>
>  Var1- Storage type str8, display format 0.9s. It has
>  month and year only like: 06/2005 .
>  I want to 1-change the format to time, 2- add day
>  dd/mm/yyyy, and 3- set dd for 15 like say: 15/05/2005.
>  Your help is very much appreciated.
>  Regards
>
>
>       ___________________________________________________________
>  Yahoo! For Good helps you make a difference
>
>  http://uk.promotions.yahoo.com/forgood/
>
>  *
>  *   For searches and help try:
>  *   http://www.stata.com/support/faqs/res/findit.html
>  *   http://www.stata.com/support/statalist/faq
>  *   http://www.ats.ucla.edu/stat/stata/
>
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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