Skip to main content

system.kanoa.schedule.getTimezoneOffsetMinsBetweenClientAndGateway(deviceUTCOffsetHrs)

Returns the difference, in minutes, between the gateway's time zone and a client device's: the gateway's UTC offset minus the device's. Add it to a time entered on the device to get the gateway's time.


Parameters​

deviceUTCOffsetHrs Float: The device's UTC offset in hours, e.g. -5.0, as a Perspective session's session.props.device.timezone.utcOffset gives it. None is 0


Returns​

offsetMins Integer


Example​

deviceUTCOffsetHrs = self.session.props.device.timezone.utcOffset
offsetMins = system.kanoa.schedule.getTimezoneOffsetMinsBetweenClientAndGateway(deviceUTCOffsetHrs)
gatewayTime = system.date.addMinutes(enteredTime, offsetMins)