Send the missing method to +time+ instance, and wrap result in a new
 TimeWithZone with the existing +time_zone+.
775760
def method_missing(sym, *args, &block)
      wrap_with_time_zone time.__send__(sym, *args, &block)
    rescue NoMethodError => e
      raise e, e.message.sub(time.inspect, inspect), e.backtrace
    end
641940
public static DateTime toDateAdvanced(Object o, TimeZone timezone) throws PageException {
	if (o instanceof Date) {
	    if (o instanceof DateTime) return (DateTime) o;
	    return new DateTimeImpl((Date) o);
	}
	else if (o instanceof Castable) return ((Castable) o).castToDateTime();
	else if (o instanceof String) {
	    DateTime dt = toDateAdvanced((String) o, timezone, null);
	    if (dt == null) throw new ExpressionException("can't cast [" + o + "] to date value");
	    return dt;
	}
	else if (o instanceof Number) return util.toDateTime(((Number) o).doubleValue());
	else if (o instanceof ObjectWrap) return toDateAdvanced(((ObjectWrap) o).getEmbededObject(), timezone);
	else if (o instanceof Calendar) {

	    return new DateTimeImpl((Calendar) o);
	}
	throw new ExpressionException("can't cast [" + Caster.toClassName(o) + "] to date value");
    }
1028292
def save(self, *args, **kwargs):
        """"""
        if self.timestamp is None:
            self.timestamp = timezone.now()

        super().save(*args, **kwargs)
734273
def set_timezone(self, request, org):
        """"""
        if org and org.timezone:
            timezone.activate(org.timezone)
282977
def now(cls, tzinfo=None):
    """"""
    obj = cls.utcnow()
    if tzinfo is None:
      tzinfo = localtz()
    return obj.astimezone(tzinfo)
397187
async def dateadd(request, value, addend, unit):
    """"""
    value = value or dt.datetime.utcnow()
    if unit == "minutes":
        delta = dt.timedelta(minutes=addend)
    else:
        delta = dt.timedelta(days=addend)
    result = value + delta
    return json_response({"result": result.isoformat()})
144084
def combine(date, time_span_with_zone)
      time_zone_offset = time_span_with_zone.time_zone_offset
      time_zone_offset = TimeSpanWithZone.default_time_zone_offset if time_zone_offset.nil?
			
      new_date_time(
        date.year,
        date.month,
        date.day,
        time_span_with_zone.hour,
        time_span_with_zone.min,
        time_span_with_zone.sec,
        time_zone_offset)
    end
714346
def update(every, timezone: nil)
            time = Scheduler.parse_in(every, :quiet) || Scheduler.parse_cron(every, :quiet, timezone: timezone)
            raise ArgumentError.new("couldn't parse \"#{o}\"") if time.nil?

            @every = time
            reschedule
        end
296430
def settime(self, time):
        
        if isinstance(time, datetime) or isinstance(time,
                                                             datetime.date):
            seconds = int(time.strftime("%s"))
        elif isinstance(time, int):
            seconds = time
        else:
            raise TypeError("datetime.date, datetime.datetime or integer " +
                            "is required as time argument")
        raise NotImplementedError
998316
def +(other)
      moment = @date_time.to_time.localtime(zone) + other.to_f.round(1)

      self.class.new(moment.strftime('%Y-%m-%dT%H:%M:%S.%N%:z'))
    end
1294246
def ensure_utc(time, tz='UTC'):
    
    if not time.tzinfo:
        time = time.replace(tzinfo=pytz.timezone(tz))
    return time.replace(tzinfo=pytz.utc)
145015
def SetTimeZone(self, time_zone):
    
    try:
      self._time_zone = pytz.timezone(time_zone)
    except (AttributeError, pytz.UnknownTimeZoneError):
      raise ValueError('Unsupported timezone: {0!s}'.format(time_zone))
346595
private void tryRegisterTimeZone() {
        try {
            registered.put(SimpleTimeZone.class, JDKStringConverter.TIME_ZONE);

        } catch (Throwable ex) {
            if (LOG) {
                System.err.println("tryRegisterTimeZone1: " + ex);
            }
        }
        try {
            TimeZone zone = TimeZone.getDefault();
            registered.put(zone.getClass(), JDKStringConverter.TIME_ZONE);

        } catch (Throwable ex) {
            if (LOG) {
                System.err.println("tryRegisterTimeZone2: " + ex);
            }
        }
        try {
            TimeZone zone = TimeZone.getTimeZone("Europe/London");
            registered.put(zone.getClass(), JDKStringConverter.TIME_ZONE);

        } catch (Throwable ex) {
            if (LOG) {
                System.err.println("tryRegisterTimeZone3: " + ex);
            }
        }
    }
1217411
def add_location_timezone_to_device(self, device_obj, location, timezone):
        
        dictify_device_meta(device_obj)
        device_obj['info']['description']['meta']['location'] = location
        device_obj['info']['description']['meta']['Location'] = location
        device_obj['info']['description']['meta']['timezone'] = timezone
        device_obj['info']['description']['meta']['Timezone'] = timezone
        return self.update_device(device_obj)
316348
public Interval withEndTime(LocalTime time) {
        requireNonNull(time);
        return new Interval(startDate, startTime, endDate, time, zoneId);
    }
383524
def timeit(func):
    

    @wraps(func)
    def timer_wrapper(*args, **kwargs):
        """
        Inner function that uses the Timer context object
        """
        with Timer() as timer:
            result = func(*args, **kwargs)

        return result, timer

    return timer_wrapper
881341
def time_zone(attr, metadata={})
      add_attribute(attr, :time_zone, metadata)
      define_method("#{attr}=") do |arg|
        instance_variable_set("@#{attr}", arg.nil? ? nil : ActiveSupport::TimeZone[arg.to_s])
      end
    end