Get our configured hour and convert it to UNIX time.
176020
private function getScheduleThreshold()
    {
        $hour = $this->app['config']->get('general/cron_hour', '03:00');

        if (is_numeric($hour)) {
            $hour .= ':00';
        }

        $this->cronHour = new \DateTime($hour);
    }
247855
def get_time(time_to_convert=None):
    """"""
    if time_to_convert is None:
        time_to_convert = time.time()
    return time.strftime(TIMESTAMP_FORMAT, time.localtime(time_to_convert))
569167
def time_to_datetime(x):
    """"""
    if isinstance(x, time):
        return datetime.combine(date(1970, 1, 1), x)
    return x
1113331
def cmd_time(self, args):
        ''''''
        tusec = self.master.field('SYSTEM_TIME', 'time_unix_usec', 0)
        if tusec == 0:
            print("No SYSTEM_TIME time available")
            return
        print("%s (%s)\n" % (time.ctime(tusec * 1.0e-6), time.ctime()))
302891
def replace(self, hour=None, minute=None, second=None, microsecond=None,
                tzinfo=True):
        """"""
        if hour is None:
            hour = self.hour
        if minute is None:
            minute = self.minute
        if second is None:
            second = self.second
        if microsecond is None:
            microsecond = self.microsecond
        if tzinfo is True:
            tzinfo = self.tzinfo
        _check_time_fields(hour, minute, second, microsecond)
        _check_tzinfo_arg(tzinfo)
        return time(hour, minute, second, microsecond, tzinfo)
1062685
function getTime(time) {
  var hours = Math.floor(time/3600);
  var minutes = Math.floor(time % 3600/60);
  var seconds = (time % 3600) % 60;

  return hours + 'h ' + minutes + 'min ' + seconds + 's';
}
777194
function convert(time) {
      var hour;
      var minute;
      hour = Math.floor(time / 60);
      if (time % 60 === 0) {
        minute = 0;
      } else {
        minute = time % 60;
      }
      return hour + ':' + (minute < 10 ? ('0' + minute) : minute);
    }
1125244
public final void mDATE_HOUR() throws RecognitionException {
		try {
			int _type = DATE_HOUR;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// druidG.g:683:2: ( DATE 'T' NUM NUM )
			// druidG.g:683:4: DATE 'T' NUM NUM
			{
			mDATE(); 

			match('T'); 
			mNUM(); 

			mNUM(); 

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
390100
def getTime(self):
    """"""
    command = '$GT'
    time = self.sendCommand(command)
    if time == ['OK','165', '165', '165', '165', '165', '85']:
      return NULL
    else:
      return datetime.datetime(year = int(time[1])+2000,
                               month = int(time[2]),
                               day = int(time[3]),
                               hour = int(time[4]),
                               minute = int(time[5]),
                               second = int(time[6]))
862967
def hourly(dt=datetime.datetime.utcnow(), fmt=None):
    
    date = datetime.datetime(dt.year, dt.month, dt.day, dt.hour, 1, 1, 0, dt.tzinfo)
    if fmt is not None:
        return date.strftime(fmt)
    return date
1347551
def normalize_time_to_netsuite_date(unix_timestamp)
      # convert to date to eliminate hr/min/sec
      time = Time.at(unix_timestamp).
        utc.
        to_date.
        to_datetime

      # tzinfo allows us to determine the dst status of the time being passed in
      # NetSuite requires that the time be passed to the API with the PDT TZ offset
      # of the time passed in (i.e. not the current TZ offset of PDT)

      if defined?(TZInfo)
        # if no version is defined, less than 2.0
        # https://github.com/tzinfo/tzinfo/blob/master/CHANGES.md#added
        if !defined?(TZInfo::VERSION)
          # https://stackoverflow.com/questions/2927111/ruby-get-time-in-given-timezone
          offset = TZInfo::Timezone.get("America/Los_Angeles").period_for_utc(time).utc_total_offset_rational
          time = time.new_offset(offset)
        else
          time = TZInfo::Timezone.get("America/Los_Angeles").utc_to_local(time)
          offset = time.offset
        end
      else
        # if tzinfo is not installed, let's give it our best guess: -7
        offset = Rational(-7, 24)
        time = time.new_offset("-07:00")
      end

      time = (time + (offset * -1))
      time.iso8601
    end
1359082
def sync_time(self):
        """"""
        now = time.localtime(time.time())
        self.remote(set_time, (now.tm_year, now.tm_mon, now.tm_mday, now.tm_wday + 1,
                               now.tm_hour, now.tm_min, now.tm_sec, 0))
        return now
833483
public static Date getTime(int hour, int minutes)
   {
      Calendar cal = popCalendar();
      cal.set(Calendar.HOUR_OF_DAY, hour);
      cal.set(Calendar.MINUTE, minutes);
      cal.set(Calendar.SECOND, 0);
      Date result = cal.getTime();
      pushCalendar(cal);
      return result;
   }
308883
def time_to_knx(timeval, dow=0):
    """"""

    knxdata = [0, 0, 0]
    knxdata[0] = ((dow & 0x07) << 5) + timeval.hour
    knxdata[1] = timeval.minute
    knxdata[2] = timeval.second
    return knxdata
405524
def access_time(self):
    """"""
    timestamp = self._fsntfs_file_entry.get_access_time_as_integer()
    return dfdatetime_filetime.Filetime(timestamp=timestamp)
331305
def format_time(start, end):
    """"""
    try:
        cpu_usr = end[0] - start[0]
        cpu_sys = end[1] - start[1]

    except TypeError:
        # `clock()[1] == None` so subtraction results in a TypeError
        return 'Time elapsed: {}'.format(human_time(cpu_usr))

    else:
        times = (human_time(x) for x in (cpu_usr, cpu_sys, cpu_usr + cpu_sys))
        return 'Time elapsed: user: {}, sys: {}, total: {}'.format(*times)
1299984
def _convertTZ(self):
        """"""
        tz = timezone.get_current_timezone()
        dtstart = self['DTSTART']
        dtend   = self['DTEND']
        if dtstart.zone() == "UTC":
            dtstart.dt = dtstart.dt.astimezone(tz)
        if dtend.zone() == "UTC":
            dtend.dt = dtend.dt.astimezone(tz)