Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3234948
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:27:02+00:00 2026-05-17T17:27:02+00:00

I use Python to track the version between local SQLite and remote web page.

  • 0

I use Python to track the version between local SQLite and remote web page. It is useful to compare them by Last-modified and file size information from the HTTP response. I found something interesting during development.

def time_match(web,sql):
  print web,sql
  t1 = time.strptime(web,"%a, %d %b %Y %H:%M:%S %Z")
  t2 = time.strptime(sql,"%Y-%m-%d %H:%M:%S")
  print t1,t2
  if t1==t2:
    print "same time"
  else:
    print "different time"
  return t1==t2

In above code, I tried to decode the time from web and SQLite into internal time and compare them. Let us check out the print screen as following:

Wed, 13 Oct 2010 01:13:26 GMT 2010-10-13 01:13:26
(2010, 10, 13, 1, 13, 26, 2, 286, 0) (2010, 10, 13, 1, 13, 26, 2, 286, -1)
different time

The result shows me that the GMT is correctly decoded, while the default timezone datetime of Python seems as -1. My system timezone is actually +8, Where is the -1 comes from? SQLite?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:27:02+00:00Added an answer on May 17, 2026 at 5:27 pm

    The -1 at the last position in the time.struct_time object does not mean you are in the ‘UTC-01:00’. It represents the undefined attribute is_dst (since YYYY-MM-DD HH:MM:SS format does not contain any information on the current timezone or daylight saving time mode).

    time.strptime('2010-10-15 11:01:02', '%Y-%m-%d %H:%M:%S')
    # returns the following on a computer with Central European Sommer Time (CEST, +02:00):
    time.struct_time(tm_year=2010, tm_mon=10, tm_mday=15, tm_hour=11, tm_min=1, tm_sec=2, tm_wday=4, tm_yday=288, tm_isdst=-1)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to use Python to convert a multi-page PDF into a series of
I would like to use Python to script an application that advertises itself as
I am trying to use Python's ctypes library to access some methods in the
I have some Python code that works correctly when I use python.exe to run
Using PyObjC , you can use Python to write Cocoa applications for OS X.
I'm developing a Django app, and I'm trying to use Python's logging module for
How would one write a regular expression to use in Python to split paragraphs?
I have written a Django app that makes use of Python threading to create
Is there any way to get Python to use my ActiveTcl installation instead of
General tutorial or good resource on how to use threads in Python? When to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.