Set the clock format, either 12h or 24h format.

    CLI Example:

    .. code-block:: bash

        salt '*' gnome.setClockFormat <12h|24h> user=<username>
966272
def setClockFormat(clockFormat, **kwargs):
    '''
    

    '''
    if clockFormat != '12h' and clockFormat != '24h':
        return False
    _gsession = _GSettings(user=kwargs.get('user'),
                           schema='org.gnome.desktop.interface',
                           key='clock-format')
    return _gsession._set(clockFormat)
1314349
def setDateTimeStart(self, dtime):
        
        self._dateStart = dtime.date()
        if self.timescale() in (self.Timescale.Minute, self.Timescale.Hour):
            self._timeStart = dtime.time()
        else:
            self._timeStart = QTime(0, 0, 0)
1201875
def set_clock(self, frequency):
        
        try:
            self._link.set_clock(frequency)
        except DAPAccess.Error as exc:
            six.raise_from(self._convert_exception(exc), exc)
159810
function setTimer(timervalue) {
    let cmdarguments = [];
    
    if (process.platform === 'linux' ) {
        if (timervalue) {
            cmdarguments.push(timervalue.toString());
        } else {
            cmdarguments.push('now');
        }
    }

    if (process.platform === 'darwin') {
        if (timervalue) {
			let timeinminutes = Math.round(Number(timervalue) / 60);
			if (timeinminutes === 0) {
				timeinminutes = 1; // min 1 minute
			}
            cmdarguments.push('-t ' + timeinminutes.toString());
        } else {
            cmdarguments.push('now');
        }
    }

    if (process.platform === 'win32') {
        if (timervalue) {
            cmdarguments.push('-t ' + timervalue.toString());
        } else {
            cmdarguments.push('-t 0'); // set to 0 because default is 20 seconds
        }
    }

    return cmdarguments;
}
652454
def persist_time(run, session, timings):
    
    from benchbuild.utils import schema as s

    for timing in timings:
        session.add(
            s.Metric(name="time.user_s", value=timing[0], run_id=run.id))
        session.add(
            s.Metric(name="time.system_s", value=timing[1], run_id=run.id))
        session.add(
            s.Metric(name="time.real_s", value=timing[2], run_id=run.id))
839776
def setTime(self, time):
        
        hour = time.hour()
        minute = time.minute()
        second = time.second()

        if not self.isMilitaryTime():
            if hour > 12:
                hour -= 12
                self._timeOfDayCombo.setCurrentIndex(1)
            else:
                self._timeOfDayCombo.setCurrentIndex(0)
            hour = str(hour)
        else:
            hour = '{0:02d}'.format(hour)

        nearest = lambda x: int(round(x/5.0)*5.0)

        self._hourCombo.setCurrentIndex(self._hourCombo.findText(hour))
        self._minuteCombo.setCurrentIndex(self._minuteCombo.findText('{0:02d}'.format(nearest(minute))))
        self._secondCombo.setCurrentIndex(self._secondCombo.findText('{0:02d}'.format(nearest(second))))
692739
def setfd(self, time):
        
        _runshell([brctlexe, 'setfd', self.name, str(time)],
            "Could not set forward delay in %s." % self.name)
129516
def set_timelimit(self, timelimit):
        """"""
        super().set_timelimit(timelimit)
        self.qparams["wall_clock_limit"] = qu.time2loadlever(timelimit)
341272
public void setTime(final long millis) {
        int millisOfDay = ISOChronology.getInstanceUTC().millisOfDay().get(millis);
        setMillis(getChronology().millisOfDay().set(getMillis(), millisOfDay));
    }
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
55769
public Dater setClock(String clock) {
		String tip = "clock format must HH:mm:ss";
		checkArgument(checkNotNull(clock).length() == 8, tip);
		List<String> pieces = Splitter.on(":").splitToList(clock);
		checkArgument(pieces.size() == 3, tip);
		return setClock(Ints.tryParse(pieces.get(0)), Ints.tryParse(pieces.get(1)), Ints.tryParse(pieces.get(2)));
	}
852167
def setTimescale( self, timescale ):
        
        self._timescale = timescale
        
        # show hour/minute scale
        if timescale == XGanttWidget.Timescale.Minute:
            self._cellWidth = 60 # (60 seconds)
            self._dateStart = QDate.currentDate()
            self._timeStart = QTime(0, 0, 0)
            
            self._dateEnd = QDate.currentDate()
            self._timeEnd = QTime(23, 59, 59)
            
        elif timescale == XGanttWidget.Timescale.Hour:
            self._cellWidth = 30 # (60 seconds / 2.0)
            
            self._dateStart = QDate.currentDate()
            self._timeStart = QTime(0, 0, 0)
            
            self._dateEnd = QDate.currentDate()
            self._timeEnd = QTime(23, 59, 59)
        
        # show day/hour scale
        elif timescale == XGanttWidget.Timescale.Day:
            self._cellWidth = 30 # (60 minutes / 2.0)
            
            self._dateStart = QDate.currentDate().addDays(-7)
            self._timeStart = QTime(0, 0, 0)
            
            self._dateEnd = QDate.currentDate().addDays(7)
            self._timeEnd = QTime(23, 59, 59)
524826
public static void setLocal(String time) {
		SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
		Date result = null;
		try {
			result = sdf.parse(time);
		}
		catch (ParseException pex) {
			throw new RuntimeException("Time is not parseable (" + time + ")", pex);
		}
		setClock(Clock.fixed(result.toInstant(), ZoneId.systemDefault()));
	}
1190312
def set_timezone(self, timezone: str):
        
        data = {"timezoneId": timezone}
        return self._restCall("home/setTimezone", body=json.dumps(data))
1258703
public static void setUtc(Date time) {
		setClock(Clock.fixed(time.toInstant(), ZoneId.of("UTC")));
	}
654929
@Override
  public void format(ZonedDateTime datetime, CalendarFormatOptions options, StringBuilder buffer) {
    String dateSkeleton = options.dateSkeleton() == null ? null : options.dateSkeleton().skeleton();
    String timeSkeleton = options.timeSkeleton() == null ? null : options.timeSkeleton().skeleton();

    CalendarFormat wrapperFormat = options.wrapperFormat();
    CalendarFormat dateFormat = options.dateFormat();
    CalendarFormat timeFormat = options.timeFormat();
    if (wrapperFormat != null) {
      // If wrapper is set it implies we want to output both a date and a time. If either is unset
      // we need to set it to the wrapper's format, unless a skeleton is defined.
      dateFormat = dateFormat != null ? dateFormat : (dateSkeleton == null ? wrapperFormat : null);
      timeFormat = timeFormat != null ? timeFormat : (timeSkeleton == null ? wrapperFormat : null);
    } else {
      // If wrapper is null, attempt to default it using the date's format or SHORT.
      if ((dateFormat != null || dateSkeleton != null) && (timeFormat != null || timeSkeleton != null)) {
        wrapperFormat = dateFormat != null ? dateFormat : CalendarFormat.SHORT;
      }
    }

    if (wrapperFormat != null) {
      formatWrapped(wrapperFormat, dateFormat, timeFormat, dateSkeleton, timeSkeleton, datetime, buffer);
      
    } else if (options.dateFormat() != null) {
      formatDate(options.dateFormat(), datetime, buffer);

    } else if (options.timeFormat() != null) {
      formatTime(options.timeFormat(), datetime, buffer);
    
    } else {
      String skeleton = dateSkeleton != null ? dateSkeleton : timeSkeleton;

      // If every property is null, fall back to this default "yMd"
      if (skeleton == null) {
        skeleton = CalendarSkeleton.yMd.skeleton();
      }
      formatSkeleton(skeleton, datetime, buffer);
    }
  }
796930
def SetTimezone(self, timezone):
    
    if not timezone:
      return

    try:
      self._timezone = pytz.timezone(timezone)
    except pytz.UnknownTimeZoneError:
      raise ValueError('Unsupported timezone: {0:s}'.format(timezone))