library("data.table")
setDTthreads(2)
t.local <- as.POSIXct("2006-01-08 10:07:52", tz = 'Europe/Madrid')
##The local time zone and the location have the same longitude (15 degrees)
local2Solar(t.local)
##But Madrid is at lon = -3
local2Solar(t.local, lon = -3)
##Daylight saving time
t.local.dst <- as.POSIXct("2006-07-08 10:07:52", tz = 'Europe/Madrid')
local2Solar(t.local.dst)
local2Solar(t.local.dst, lon = -3)
Run the code above in your browser using DataLab