HH:MM:SS to ZT time - logic question

I am hoping somebody can help me with a logic question in R-studio. I have a rather large data set, with "Time" as one of my columns. This column has values from 00:00:00 to 23:59:00, and is in HH:MM:SS format.

Because of some trouble I have had with analysis of time in this format, I am trying to create a new column, called "ZT" where I convert this time column to ZT time. Lights turn on at 7am, so need the time 07:00:00 to correspond to ZT=0, with 07:01:00 to correspond to ZT=0.016... and so on and so forth.

Can anybody help me with this? It would be much appreciated!

suppressPackageStartupMessages(library(lubridate))
now()
#> [1] "2020-10-27 14:24:13 PDT"
now() - hours(7)
#> [1] "2020-10-27 07:24:13 PDT"

Created on 2020-10-27 by the reprex package (v0.3.0.9001)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.