Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: string translation : date & time


From   Abhimanyu Arora <[email protected]>
To   [email protected]
Subject   Re: st: string translation : date & time
Date   Wed, 26 Oct 2011 14:31:54 +0200

Sorry missed out -replace-

On Wed, Oct 26, 2011 at 2:30 PM, Abhimanyu Arora
<[email protected]> wrote:
> Alright statalist, happy to share how I worked my way out. I appended
> the following command to the earlier ones.
> temp=monthly(date,"MY",2100) if yofd(dofm(monthly(date,"MY",2000)))<1920
> While I haven't been able to figure out the explanation still,
> nevertheless, I am a bit hesitant to cry bug!
> Cheers
> Abhimanyu
>
>
>
>
> On Wed, Oct 26, 2011 at 12:43 PM, Abhimanyu Arora
> <[email protected]> wrote:
>> Dear statalist
>> I just got myself in a puzzling situation.
>> I had a variable string variable date taking up values
>> Jan-90...Jan-99...Jan-00...Jan-01...Jan-10 and so on for different
>> months.
>> Making use of the time and date functions I typed the following commands
>>
>> gen temp=monthly(date,"MY",2000) *2000 is the base year*
>>
>> Subsequently, -format temp %tm - yields for the above months
>> respectively, 1990m1...1999m1...2000m1...1901m1...1910m1 and so on.
>>
>> I an eager to know what could be the possible reason? And possible
>> rectifying steps (both in terms of the possible commands I used
>> initially and suppose given the output, into the desired form which is
>> needless to say is 2001m1, 2010m1 etc?
>>
>> Best regards
>> Abhimanyu
>> *
>> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index