Date: Tue, 4 Aug 1998 11:47:25 -0400
Reply-To: "abdu.elnagheeb(a)nationsbank.com"
<abdu.elnagheeb@NATIONSBANK.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: "abdu.elnagheeb(a)nationsbank.com"
<abdu.elnagheeb@NATIONSBANK.COM>
Subject: Re: Character to date (Thanks)
First, thanks to all who responded to me privately or on the list.
Very helpful answers (though diverse.) Just FYI, the way I approached
it was:
NewYr = Substr(My yyyymmdd Varible,3,2) ;
NewMo = Substr(My yyyymmdd Varible,5,2) ;
NewDy = Substr(My yyyymmdd Varible,7,2) ;
***days since yyyymmdd upto 8/4/98*****;
Days = 365*(98 - NewYr) + 30*(8 - NewMo) + (4 - NewDy) ;
I thought there ought to be a more efficient way as your messages
proved that. I'm not sure which one will be more accurate (with some
months 28,29,30,or 31 days.)
Abdu
>>>>>>>>>>>>>
Hello all,
I hope someone will help me woth this.
I have a variable which is character of the form yyyymmdd where yyyy
is the year, mm is the month and dd is the day (e.g. 19970603 for June
3, 1997.) I want to calculate the time between that date and today's
date. What is the best way to do that? How to convert that character
variable to date of the form yymmdd (or other format: ddmmyy)?
Thanks for your help.
abdu
|