Giter VIP home page Giter VIP logo

Comments (5)

davisp avatar davisp commented on May 20, 2024

Odd, can you show what you get from running this in the python prompt?

import time
print time.strftime('%z')

I'm guessing its giving you "GMT Standard Time" which should theoretically be a number like -0:00. Assuming that's what it is you'll want to either figure out how to make your time.strftime('%z') call return an appropriate timezone offset instead of a random string name.

from ghp-import.

mikofski avatar mikofski commented on May 20, 2024

The issue is that the OP and myself are using Python-2.7 not Python-3.x in which the lower case '%z' escape is not guaranteed to return the hour offset. See this SO answer and the footnote in the Python-2 docs for time.

The solutions are:

  1. use Python-3 instead of Python-2

  2. send a PR to this repo, to change L120 to:

     currtz = datetime.now(tz.tzlocal()).strftime('%z')
    

    NOTE: you must import tz from dateutil in this module to use tz.tzlocal()

works for both versions of Python on all platforms (win32, darwin, linux2).

from ghp-import.

osinimu avatar osinimu commented on May 20, 2024

Did this work? Having a similar issue
capture

I tried @mikofski suggestions but nothing changed

from ghp-import.

mikofski avatar mikofski commented on May 20, 2024

But @osinimu you are still using Python-2.7, not Python-3. Can you please try Python-3? You can install Python-3.6 side-by-side with Python-2.7, use virtualenv in either Python 2 or 3 to create a Python-3 virtual environment, and then just install the packages you need for Pelican.

~/osinimu (pelican) $ virtualenv -p /c/Program\ Files/Python36/python.exe venv3
~/osinimu (pelican) $ source venv3/bin/activate
(venv3) ~/osinimu (pelican) $ pip install pelican ghp-import

from ghp-import.

c-w avatar c-w commented on May 20, 2024

This has been released in 0.6.0.

from ghp-import.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.