473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Feedparser and dates

I'm using FeedParser.org to import feeds into our MySQL database.
Our problem is that we haven't found a solution to translate the date
of a post item into GMT.

Any ideas?

Thanks,
Jacob

Mar 15 '06 #1
1 1739
"friis" wrote:
I'm using FeedParser.org to import feeds into our MySQL database.
Our problem is that we haven't found a solution to translate the date
of a post item into GMT.


from what I can tell, feedparser returns a 9-item UTC time tuple (which
is the same thing as GMT, at least for all practical purposes).

if it's a standard timestamp you want, you can use calendar.timegm:
t = (2004, 1, 1, 19, 48, 21, 3, 1, 0)
import calendar
calendar.timegm(t) 1072986501 import time, datetime
time.asctime(time.gmtime(calendar.timegm(t))) 'Thu Jan 01 19:48:21 2004' datetime.datetime.utcfromtimestamp(calendar.timegm (t))

datetime.datetime(2004, 1, 1, 19, 48, 21)

</F>

Mar 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: PW | last post by:
<rant> Sorry guys, but I just have to whinge. Dates in ASP are a total pain in the butt! I seem to get caught out so many times. I realise its my own fault, but going from the posts in this...
10
by: Colin Steadman | last post by:
I'm a stupid ASP programmer and I dont do Javascript (except for very simple tasks anyway), and I'm in a bit of a predicament. I've used a javascript table sorting script from here: ...
1
by: Don Sealer | last post by:
I have a report that includes 5 different subreports. I'd like to be able to open this report using a date function (Start Date and End Date). I'd like all five subreports to show the data from...
12
by: Dixie | last post by:
I am trying to calculate the number of workdays between two dates with regards to holidays as well. I have used Arvin Meyer's code on the Access Web, but as I am in Australia and my date format is...
1
by: pitfour.ferguson | last post by:
My dbase has the start date and end date of each visit. How can I ask Access to list the day of the week of the start (easy), end (easy) and, more importantly, the dates of the visit itself - ie...
2
by: Roberto Bechtlufft | last post by:
Hi, I'm new around here... I'm a Python hobbyist, and I'm far from being a professional programmer, so please be patient with me... I'm working on my first Python program: a curses based RSS...
2
by: Jim Carlock | last post by:
(1) Does PHP provide any way to handle dates prior to 1980? I know there's problems with Microsoft Windows NT and all Windows NT operating systems will allow a date prior to 1980 to be placed...
1
by: Gabriel Genellina | last post by:
En Tue, 13 May 2008 07:30:44 -0300, Mike <42flicks@gmail.comescribió: The easiest way would be to put the single module feedparser.py in the same directory as your program (I don't completely...
1
by: sebey | last post by:
ok so I know about why its good but I am building a website that imports rss feeds form external place in this case Talkshoe.com and feedparser seens to think that podcast.feed.description has html...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.