Displays the current time zone

    :return: The current time zone
    :rtype: str

    CLI Example:

    .. code-block:: bash

        salt '*' timezone.get_zone
332500
def get_zone():
    '''
    
    '''
    ret = salt.utils.mac_utils.execute_return_result('systemsetup -gettimezone')
    return salt.utils.mac_utils.parse_return(ret)
1249213
def get_timezone(as_timedelta=False):
    
    try:
        offset_hour = -(time.altzone if time.daylight else time.timezone)
    except Exception as e:
        offset_hour = -(datetime.datetime.now() -
                        datetime.datetime.utcnow()).seconds

    offset_hour = offset_hour // 3600
    offset_hour = offset_hour if offset_hour < 10 else offset_hour // 10

    if as_timedelta:
        return datetime.timedelta(hours=offset_hour)

    return 'Etc/GMT%+d' % offset_hour
392872
function now() {
		if (strtolower($this->timeReference) == 'gmt') {
			$now = time();
			$system_time = mktime(gmdate("H", $now), gmdate("i", $now), gmdate("s", $now), gmdate("m", $now), gmdate("d", $now), gmdate("Y", $now));
			if (strlen($system_time) < 10) {
				$system_time = time();
			}
			return $system_time;
		} else {
			return time();
		}
	}
1117510
def _get_cached_time(self):
        
        if not self._cached_time:
            self._cached_time = self._meta.datetime.utcnow()

        return self._cached_time
1029558
def get_datetimenow(self):
        
        value = timezone.datetime.utcnow()
        if settings.USE_TZ:
            value = timezone.localtime(
                timezone.make_aware(value, timezone.utc),
                timezone.get_default_timezone()
            )
        return value
564833
def in_timezone(self, tz):  # type: (Union[str, Timezone]) -> DateTime
        
        tz = pendulum._safe_timezone(tz)

        return tz.convert(self, dst_rule=pendulum.POST_TRANSITION)
582507
def get_zone():
    '''
    
    '''
    cmd = ['tzutil', '/g']
    res = __salt__['cmd.run_all'](cmd, python_shell=False)
    if res['retcode'] or not res['stdout']:
        raise CommandExecutionError('tzutil encountered an error getting '
                                    'timezone',
                                    info=res)
    return mapper.get_unix(res['stdout'].lower(), 'Unknown')
615493
public static current_timezone[] get_filtered(nitro_service service, String filter) throws Exception
	{
		current_timezone obj = new current_timezone();
		options option = new options();
		option.set_filter(filter);
		current_timezone[] response = (current_timezone[]) obj.getfiltered(service, option);
		return response;
	}
282977
def now(cls, tzinfo=None):
    """"""
    obj = cls.utcnow()
    if tzinfo is None:
      tzinfo = localtz()
    return obj.astimezone(tzinfo)
205745
def offset_to_timezone(offset, now=None):
    
    now = now or datetime.now()

    # JS offsets are flipped, so unflip.
    user_offset = -offset

    # Helper: timezone offset in minutes
    def get_tz_offset(tz):
        try:
            return tz.utcoffset(now).total_seconds() / 60
        except (pytz.NonExistentTimeError, pytz.AmbiguousTimeError):
            return tz.localize(now, is_dst=False).utcoffset().total_seconds() / 60

    # Return the timezone with the minimum difference to the user's offset.
    return min(
        (pytz.timezone(tz_name) for tz_name in get_prioritized_timezones()),
        key=lambda tz: abs(get_tz_offset(tz) - user_offset),
    )
188076
def get_offset():
    '''
    
    '''
    # http://craigglennie.com/programming/python/2013/07/21/working-with-timezones-using-Python-and-pytz-localize-vs-normalize/
    tz_object = pytz.timezone(get_zone())
    utc_time = pytz.utc.localize(datetime.utcnow())
    loc_time = utc_time.astimezone(tz_object)
    norm_time = tz_object.normalize(loc_time)
    return norm_time.strftime('%z')
361775
def get_current_date_time(i):
    

    import datetime

    a={}

    now1=datetime.datetime.now()
    now=now1.timetuple()

    a['date_year']=now[0]
    a['date_month']=now[1]
    a['date_day']=now[2]
    a['time_hour']=now[3]
    a['time_minute']=now[4]
    a['time_second']=now[5]

    return {'return':0, 'array':a, 'iso_datetime':now1.isoformat()}
1219999
def get_now_utc():
    ''' '''

    # Helper class for UTC time
    # Source: http://stackoverflow.com/questions/2331592/datetime-datetime-utcnow-why-no-tzinfo
    ZERO = datetime.timedelta(0)
    class UTC(datetime.tzinfo):
        """UTC"""
        def utcoffset(self, dt):
            return ZERO
        def tzname(self, dt):
            return "UTC"
        def dst(self, dt):
            return ZERO

    #now = datetime.datetime.now(timezone.utc) # Python 3.2
    now = datetime.datetime.now(UTC())
    return now
628891
def strftime(date_time=None, time_format=None):
        
        if not date_time:
            datetime_now = datetime.now()
        else:
            datetime_now = date_time
        if not time_format:
            time_format = '%Y/%m/%d %H:%M:%S'
        return datetime.strftime(datetime_now, time_format)
1190312
def set_timezone(self, timezone: str):
        
        data = {"timezoneId": timezone}
        return self._restCall("home/setTimezone", body=json.dumps(data))
10689
private static String getClientTimeZone() {
        return ZonedDateTime.now(SPDateTimeUtil.getTimeZoneId(SPDateTimeUtil.getBrowserTimeZone())).getOffset().getId()
                .replaceAll("Z", "+00:00");
    }
1028266
def current(class_):
		""
		tzi = class_()
		kernel32 = ctypes.windll.kernel32
		getter = kernel32.GetTimeZoneInformation
		getter = getattr(kernel32, 'GetDynamicTimeZoneInformation', getter)
		code = getter(ctypes.byref(tzi))
		return code, tzi