Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Time Format: msg#00011

cms.opengroupware.xmlrpc.devel

Subject: Re: Time Format

Angela Kuehn schrieb:
Hello,

I want to import dates from some files into OGo via the XMLRPC interface. Unfortunately the dates in the file are in a local time format. How can I search and import such a time format? The dates in the OGo database have also local time format (date+time+02:00 for example.)

Greetings

Angela

I am using the Python-Fragment:

import xmlrpclib, sys, pg
from time import *

# Bibliotheksfehler beim Berechnen der gmtime??
bibliotheksfehler=strftime("%H",\
gmtime(mktime(strptime("2004-03-03","%Y-%m-%d"))))==\
strftime("%H",gmtime(mktime(strptime("2004-06-06","%Y-%m-%d"))))
# Bibliotheksfehler Ende

def normalzeit(s,o):
""" utc-zeit mit offset """
z=mktime(strptime(s,"%Y-%m-%d"))+o
if bibliotheksfehler:
if ("2004-03-28"<=s<"2004-10-31") or ("2005-03-27"<=s<"2005-10-30") \
or ("2006-03-26"<=s<"2006-10-29"):
z=z-3600.0
return strftime("%Y%m%dT%H:%M:%S",gmtime(z))

...

startDate=normalzeit(vondatum,0)
endDate=normalzeit(bisdatum,24.0*3600-1)

...


# Eintrag einrichten
dict = {}
dict['startDate']=xmlrpclib.DateTime(startDate)
dict['endDate']=xmlrpclib.DateTime(endDate)
dict['title']="Titel"

eintrag = server.appointment.insert(dict)


8-)

Eberhard Froriep

--
NAME Eberhard Froriep
ADRESSE RRZN, Schlosswenderstr.5, 30159 Hannover
TEL +49-511-762-4721, FAX -3003
EMAIL froriep@xxxxxxxxxxxxxxxxxxxx

--
OpenGroupware.org XML-RPC
xmlrpc@xxxxxxxxxxxxxxxxx
http://mail.opengroupware.org/mailman/listinfo/xmlrpc



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
db.postgresql.b...    video.ffmpeg.us...    gis.qgis.devel/...    web.rdf.redland...    file-systems.oc...    recreation.rail...    systems.archos....    python.c++/2003...    lang.c--/2005-0...    multimedia.gpho...    network.unison....    editors.jedit.u...    hardware.pciids...    cms.tiki.cvs/20...    bug-tracking.ma...    java.hadoop.hba...    ietf.rsvp/2002-...    xfree86.devel/2...    qnx.openqnx.dev...    apache.labs.dev...    tex.pdftex/2008...    os.solaris.open...    user-groups.lin...    kde.koffice/200...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation