Did I find the right examples for you? yes no

All Samples(41)  |  Call(21)  |  Derive(0)  |  Import(20)
Get the computers configured local timezone, if any.

        def get_localzone():
    """Get the computers configured local timezone, if any."""
    global _cache_tz
    if _cache_tz is None:
        _cache_tz = _get_localzone()
    return _cache_tz
        


src/s/t/starcal-HEAD/scal2/time_utils.py   starcal(Download)
import pytz
 
from tzlocal import get_localzone
 
from scal2.cal_types.gregorian import J0001, J1970
def getUtcOffsetByEpoch(epoch, tz=None):
    if not tz:
        tz = get_localzone()
    try:
        return tz.utcoffset(datetime.fromtimestamp(epoch)).total_seconds()
def getUtcOffsetByDateSec(year, month, day, tz=None):
    if not tz:
        tz = get_localzone()
    try:
        return tz.utcoffset(datetime(year, month, day)).total_seconds()

src/c/h/chisubmit-0.1.1/src/chisubmit/common/utils.py   chisubmit(Download)
import datetime
import pytz
from tzlocal import get_localzone
 
def create_subparser(subparsers, name, func):
def convert_timezone_to_local(dt):
    tz = get_localzone()
    dt = dt.astimezone(tz)
    return tz.normalize(dt)
 

src/z/a/zato-HEAD/code/zato-server/src/zato/server/base/parallel.py   zato(Download)
 
# tzlocal
from tzlocal import get_localzone
 
# Zato
        cid = kwargs.get('cid', new_cid())
 
        wsgi_environ['zato.local_tz'] = get_localzone()
        wsgi_environ['zato.request_timestamp_utc'] = utcnow()
 

src/s/t/starcal-HEAD/scal2/core.py   starcal(Download)
from pprint import pprint
 
from tzlocal import get_localzone
 
from scal2.path import *
#print('--------- Hello %s'%userDisplayName)
 
localTz = get_localzone()
 
#print('__file__ = %r'%__file__)

src/s/t/starcal-HEAD/plugins/pray_times.py   starcal(Download)
sys.path.insert(0, rootDir)## FIXME
 
from tzlocal import get_localzone
 
from scal2 import plugin_api as api
confPath = join(plugConfDir, 'pray_times')
earthR = 6370
localTz = get_localzone()
 
####################################################

src/g/d/gdrive_sync-0.5/gdrive_sync/gdrive_sync.py   gdrive_sync(Download)
import os, datetime
from tzlocal import get_localzone
 
from .configuration import Configuration
from .change_db import ChangeDB, GDriveFile, GDriveDirectory
    pass
 
SYSTEM_TZ = get_localzone()
 
class GDriveSyncDifference(object):

src/j/c/jc-toggl-HEAD/alfred_toggl.py   jc-toggl(Download)
# -*- coding: utf-8 -*-
 
from jcalfred import Workflow, Item, JsonFile
from tzlocal import get_localzone
import datetime
LOG = logging.getLogger(__name__)
CACHE_LIFETIME = 300
LOCALTZ = get_localzone()
DATE_FORMAT = '%m/%d'
CONFIG_HEADER = '''

src/j/r/jrnl-1.7.20/jrnl/Journal.py   jrnl(Download)
                        timezone = pytz.timezone(dict_entry['Time Zone'])
                    except (KeyError, pytz.exceptions.UnknownTimeZoneError):
                        timezone = tzlocal.get_localzone()
                    date = dict_entry['Creation Date']
                    date = date + timezone.utcoffset(date, is_dst=False)
                    'Starred': entry.starred if hasattr(entry, 'starred') else False,
                    'Entry Text': entry.title+"\n"+entry.body,
                    'Time Zone': str(tzlocal.get_localzone()),
                    'UUID': entry.uuid,
                    'Tags': [tag.strip(self.config['tagsymbols']) for tag in entry.tags]

src/c/h/channelarchiver-0.0.4/channelarchiver/utils.py   channelarchiver(Download)
import calendar
import re
from tzlocal import get_localzone
 
try:
 
utc = UTC()
local_tz = get_localzone()
 

src/r/u/rutherford-0.7/rutherford/__init__.py   rutherford(Download)
from sphinx.util.compat import Directive
from tinkerer import __version__ as tinkerer_version
from tzlocal import get_localzone
 
log = logging.getLogger('rutherford')
    idpath = parts.path.strip('/').replace("/", ":")
 
    tz = get_localzone()
 
    # feed items

  1 | 2  Next