From 5a791ea736815c695175a4e8cc55cbaaf5a685df Mon Sep 17 00:00:00 2001 From: l-k- Date: Fri, 19 Jan 2024 20:14:34 -0500 Subject: [PATCH] timezone of starttime_posix doesn't matter starttime_posix later gets converted with as.numeric(), which produces a Unix timestamp, which is always in UTC. So converting starttime_posix from configtz timezone to desiredtz doesn't achieve anything. The only thing that matters is that we use the correct timezone when converting from the original string representation to the POSIX object. This extra operation wasn't breaking anything, but I think it's better to remove it so that there isn't any illusion from reading the code that the returned timestamps are somehow in desiredtz. They are unix timestamps, in UTC. --- R/readGENEActiv.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/R/readGENEActiv.R b/R/readGENEActiv.R index a394343..ff397ce 100644 --- a/R/readGENEActiv.R +++ b/R/readGENEActiv.R @@ -65,8 +65,6 @@ readGENEActiv = function(filename, start = 0, end = 0, progress_bar = FALSE, } else { starttime_posix = as.POSIXlt(starttime, tz = configtz, format = "%Y-%m-%d %H:%M:%OS", origin = "1970-01-01") - starttime_posix = as.POSIXlt(as.numeric(starttime_posix), - tz = desiredtz, origin = "1970-01-01") } # Correct timestamps