- Problem with "date" variable
Hi There, Tying to play with date variable <!--#var date fmt=DayOfWeek-->, I Obtained the following error : ================================================= <HTML><HEAD><TITLE>DB</TITLE></HEAD><BODY BGCOLOR="#FFFFFF"> <TABLE BORDER="0" WIDTH="100%"> <TR> <TD WIDTH="10%" ALIGN="CENTER"> <STRONG><FONT SIZE="+6" COLOR="#77003B">!</FONT></STRONG> </TD> <TD WIDTH="90%"><BR> <FONT SIZE="+2">System Unavailable</FONT> <P>This site is currently experiencing technical difficulties. Please contact the site administrator for more information. For additional technical information, please refer to the HTML source for this page. Thank you for your patience.</P> </TD> </TR> </TABLE> <!-- Error type: Error value: date --> </BODY></HTML> <!-- Traceback (innermost last): File /opt/digicool/zope/Zope-1.9.0- src/lib/python/ZPublisher/Publish.py, line 879, in publish_module File /opt/digicool/zope/Zope-1.9.0- src/lib/python/ZPublisher/Publish.py, line 595, in publish (Info: /Seminar/DB/Insert_Total_Form) File /opt/digicool/zope/Zope-1.9.0- src/lib/python/OFS/Document.py, line 181, in __call__ (Object: Insert_Total_Form) File /opt/digicool/zope/Zope-1.9.0- src/lib/python/OFS/Document.py, line 177, in __call__ (Object: Insert_Total_Form) File /opt/digicool/zope/Zope-1.9.0- src/lib/python/DocumentTemplate/DT_String.py, line 514, in __call__ (Object: Insert_Total_Form) File /opt/digicool/zope/Zope-1.9.0- src/lib/python/DocumentTemplate/DT_Var.py, line 249, in render (Object: DateTime) KeyError: (see above) --> ================================================= François-Régis Chalaoux Bioinformatics Group Synthélabo Biomoléculaire 67080 Strasbourg Cedex FRANCE Tél : 03 88 60 87 14 Fax : 03 88 45 90 70
FR Chalaoux wrote:
Hi There,
Tying to play with date variable <!--#var date fmt=DayOfWeek-->, I Obtained the following error :
Do you have a date variable defined? It looks like you don't. It you want the current date and time, use PrincipiaTime: <!--#var PrincipiaTime fmt=DayOfWeek--> (Note that this will be renamed ZopeTime in 1.10, although PrincipiaTime will still work.) Jim -- Jim Fulton mailto:jim@digicool.com Technical Director (888) 344-4332 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Ok, mindlessly simple question time: If you've got a time in epoch form (for example, coming out of a database), how would you translate that into a DateTime object? KevinL
Jim Fulton wrote FR Chalaoux wrote:
Hi There,
Tying to play with date variable <!--#var date fmt=DayOfWeek-->, I Obtained the following error :
Do you have a date variable defined? It looks like you don't.
It you want the current date and time, use PrincipiaTime:
<!--#var PrincipiaTime fmt=DayOfWeek-->
(Note that this will be renamed ZopeTime in 1.10, although PrincipiaTime will still work.)
Jim
--------------- qnevhf@obsu.arg.nh --------------- Kevin Littlejohn, Technical Architect, Connect.com.au Don't anthropomorphise computers - they hate that.
Hi, Try this: <!--#var "PrincipiaTime(EPOCHDATE)"--> Where EPOCHDATE coming from a SQLMethod. Arpad Kiss <199901190630.raa2909-@nara.off.connect.com.au> wrote: Original Article: http://www.egroups.com/list/zope/?start=1221
Ok, mindlessly simple question time:
If you've got a time in epoch form (for example, coming out of a database), how would you translate that into a DateTime object?
KevinL
Jim Fulton wrote FR Chalaoux wrote:
Hi There,
Tying to play with date variable <!--#var date fmt=DayOfWeek-->, I Obtained the following error :
Do you have a date variable defined? It looks like you don't.
It you want the current date and time, use PrincipiaTime:
<!--#var PrincipiaTime fmt=DayOfWeek-->
(Note that this will be renamed ZopeTime in 1.10, although PrincipiaTime will still work.)
Jim
--------------- qnevhf@obsu.arg.nh --------------- Kevin Littlejohn, Technical Architect, Connect.com.au Don't anthropomorphise computers - they hate that.
arpadk@geometria.hu wrote:
Hi, Try this: <!--#var "PrincipiaTime(EPOCHDATE)"--> Where EPOCHDATE coming from a SQLMethod.
I'd forgotten all about that. Note that this will work with any DateTime arguments: <!--#var "PrincipiaTime(1999,1,18)"--> or <!--#var "PrincipiaTime('Tue, 19 Jan 1999 06:17:56 -0500')"--> Jim -- Jim Fulton mailto:jim@digicool.com Technical Director (540) 371-6909 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Kevin Littlejohn wrote:
Ok, mindlessly simple question time:
If you've got a time in epoch form (for example, coming out of a database), how would you translate that into a DateTime object?
Right now, you have to Python (via an external method or a product): import DateTime date=DateTime.DateTime(epochTime) In 1.10, the DateTime constructor will be available via the '_' special variable in DTML. Jim
KevinL
Jim Fulton wrote FR Chalaoux wrote:
Hi There,
Tying to play with date variable <!--#var date fmt=DayOfWeek-->, I Obtained the following error :
Do you have a date variable defined? It looks like you don't.
It you want the current date and time, use PrincipiaTime:
<!--#var PrincipiaTime fmt=DayOfWeek-->
(Note that this will be renamed ZopeTime in 1.10, although PrincipiaTime will still work.)
Jim
--------------- qnevhf@obsu.arg.nh --------------- Kevin Littlejohn, Technical Architect, Connect.com.au Don't anthropomorphise computers - they hate that.
-- Jim Fulton mailto:jim@digicool.com Technical Director (540) 371-6909 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (5)
-
arpadk@geometria.hu -
chalaouxf@synbio.tpgnet.net -
Jim Fulton -
Jim Fulton -
Kevin Littlejohn