Fix: right way to use local timezone

This commit is contained in:
ECAILLE Fabrice (externe)
2017-03-17 11:48:59 +01:00
parent 17c5561d14
commit 7ed0ba7387
2 changed files with 4 additions and 1 deletions

View File

@@ -10,6 +10,8 @@ import sys
import argparse
from faker import Faker
from random import randrange
from tzlocal import get_localzone
local = get_localzone()
#todo:
# allow writing different patterns (Common Log, Apache Error log etc)
@@ -84,7 +86,7 @@ while (flag):
ip = faker.ipv4()
dt = otime.strftime('%d/%b/%Y:%H:%M:%S')
tz = datetime.datetime.now().strftime('%z')
tz = datetime.datetime.now(local).strftime('%z')
vrb = numpy.random.choice(verb,p=[0.6,0.1,0.1,0.2])
uri = random.choice(resources)

View File

@@ -2,3 +2,4 @@ fake-factory==0.7.2
numpy==1.11.2
Faker==0.7.3
pytz==2016.7
tzlocal==1.3.0