0

I try to convert three dates from character to strptime

Using times1

times1 <- c("26/Mar/2015 12:47:27", "28/Mar/2015 13:15:59", "31/Mar/2015 10:05:26")

# times1
# >[1] "26/Mar/2015 12:47:27" "28/Mar/2015 13:15:59" "31/Mar/2015 10:05:26"

# conversion
times1 <- strptime(times1, "%d/%b/%Y %H:%M:%S")

# times1
# > [1] NA NA

all the dates are NA after the conversion.

Choosing other dates in times2

times2 <- c("17/Apr/2015 22:17:42", "24/Apr/2015 00:04:56")

# times2
# > [1] "17/Apr/2015 22:17:42" "24/Apr/2015 00:04:56"

# conversion
times2 <- strptime(times2, "%d/%b/%Y %H:%M:%S")

# times2
# > [1] "2015-04-17 22:17:42 CEST" "2015-04-24 00:04:56 CEST"

I can convert them without a problem.

Both converted variables are of the class "POSIXlt" "POSIXt".

I think it is not a summer-/wintertime issue. I am in Germany (Berlin time), in case it matters.

rmuc8
  • 2,869
  • 7
  • 27
  • 36

0 Answers0