Skip to content

Commit

Permalink
timezone of starttime_posix doesn't matter
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
l-k- committed Jan 20, 2024
1 parent ca5a879 commit 5a791ea
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions R/readGENEActiv.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5a791ea

Please sign in to comment.