Re: [R] Help with Converting Excel Times to R

2021-07-26 Thread PIKAL Petr
Hi Maybe I am completely wrong but when you import Excel datetimes the result is character, which can be converted to date format quite simply by strptime In case of numerisc format you need to convert date number to seconds. But you could have problems with your OS as on my system I need to set

Re: [R] Help with Converting Excel Times to R

2021-07-21 Thread Shawn Way
Original Message- From: Jim Lemon Sent: Wednesday, July 21, 2021 6:09 PM To: Shawn Way Cc: r-help@r-project.org Subject: Re: [R] Help with Converting Excel Times to R Hi Shawn, I don't have any trouble with this: times<-c("7/20/21 13:30","7/20/21 13:40") strpt

Re: [R] Help with Converting Excel Times to R

2021-07-21 Thread Andrew Simmons
Hello, >From playing around with your numbers, it seems like you are using Excel 1904 Date System, which isn't a problem, it just means that your numbers are days from 1904-01-01 instead of 1900-01-01. The following is my solution: times <- c(42935.5625,42935.569444) as.POSIXlt(( # off

Re: [R] Help with Converting Excel Times to R

2021-07-21 Thread Jim Lemon
Hi Shawn, I don't have any trouble with this: times<-c("7/20/21 13:30","7/20/21 13:40") strptime(times,"%m/%d/%y %H:%M",tz="GMT") [1] "2021-07-20 13:30:00 GMT" "2021-07-20 13:40:00 GMT" I suspect that Excel is causing the problem. Try changing the format of the date column to "Text" and work on t