Hi
I’m trying to work out the best way to get the time zone from a file. There is the calculateTimeZone method which relies on sun settings. But the SunSettings.Current node sometime fails becuase presumably the user is in a view with no sun settings (not sure if this is possible but it does fail).
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
#The inputs to this node will be stored as a list in the IN variable.
sunSettings = IN[0]
timeZone = sunSettings.InternalElement.TimeZone
DST = sunSettings.InternalElement.UsesDST
#Assign your output to the OUT variable
OUT = timeZone, DST
The other way appears to be the TimeZone Property which is after a city. Is this a more robust way of obtaining the time zone and if so, what is the best way to get it?