public string TimeZonePresentation(string id) { try { return(TimeZoneConverter.TimeZonePresentation(id)); } catch (TimeZoneNotFoundException) { throw RuntimeException.InvalidNthArgumentValue(1); } }
public int StandardTimeOffset(string timeZone = null, IValue universalTime = null) { try { return(TimeZoneConverter.StandardTimeOffset(timeZone, universalTime?.AsDate())); } catch (TimeZoneNotFoundException) { throw RuntimeException.InvalidNthArgumentValue(1); } }
public IValue ToUniversalTime(IValue localTime, string timeZone = null) { try { var dt = TimeZoneConverter.ToUniversalTime(localTime.AsDate(), timeZone); return(ValueFactory.Create(dt)); } catch (TimeZoneNotFoundException) { throw RuntimeException.InvalidNthArgumentValue(2); } }
public ArrayImpl GetAvailableTimeZones() { return(new ArrayImpl(TimeZoneConverter.GetAvailableTimeZones() .Select(x => ValueFactory.Create(x)))); }
public string TimeZone() { return(TimeZoneConverter.TimeZone()); }