Try this:

> x <- 'Date1      Date2
+ 032398    061585
+ 032398    061585
+ 111694    101994
+ 111694    101994
+ 062695    021595
+ 051898    111597
+ 072495    040195
+ 072495    040195'
> data.in <- read.table(textConnection(x), header=TRUE,
colClasses=c('character', 'character'))
> data.in$Date1 <- as.POSIXct(strptime(data.in$Date1, "%m%d%y"))
> data.in$Date2 <- as.POSIXct(strptime(data.in$Date2, "%m%d%y"))
> data.in$diff <- difftime(data.in$Date1, data.in$Date2, units='days')
>
>
> data.in
       Date1      Date2 diff
1 1998-03-23 1985-06-15 4664
2 1998-03-23 1985-06-15 4664
3 1994-11-16 1994-10-19   28
4 1994-11-16 1994-10-19   28
5 1995-06-26 1995-02-15  131
6 1998-05-18 1997-11-15  184
7 1995-07-24 1995-04-01  114
8 1995-07-24 1995-04-01  114
>



On 12/27/06, Brian Edward <perronbe@gmail.com> wrote:
>
> Hello all,
>
> Can somebody point me to references or provide some code on dealing with
> this date issue.  Basically, I have two vectors of values that represent
> dates.  I want to convert these values into a date format and subtract the
> differences to show elapsed time in days.  More specifically, here is the
> example:
>
> Date1      Date2
> 032398    061585
> 032398    061585
> 111694    101994
> 111694    101994
> 062695    021595
> 051898    111597
> 072495    040195
> 072495    040195
>
> The dates are in the mmddyy format, but when I attempt to format these in
> R
> with the function, date.mmddyy(Date1), I get very odd results.  Any help
> on
> this matter would be greatly appreciated!
>
> Thanks in advance,
> Brian
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

	[[alternative HTML version deleted]]

