Passing the current date to an SQL query
What's the best way of doing this? I'm struggling to find any mention of the *current* date in the documentation; I've looked in the Zope DTML User's Guide and the Zope SQL Methods User's Guide. regards Peter.
At 4:55 pm +0100 20/9/99, Peter Whysall wrote:
What's the best way of doing this?
I'm struggling to find any mention of the *current* date in the documentation; I've looked in the Zope DTML User's Guide and the Zope SQL Methods User's Guide.
regards
Peter.
that'll be <dtml-var ZopeTime fmt=aCommon>, which renders the date in the following format Sep 20, 1999 5:18 pm the DTML users guide has more of these format strings in Appendix A - Date-Time data. tone ------ Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5888 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
Here is what I use to put the current date into a MySQL field: "<dtml-var ZopeTime fmt="19%y-%m-%d">" 1999-04-25 INSERT INTO askref VALUES (NULL,"<dtml-var ZopeTime fmt="19%y-%m-%d">", "<dtml-var username>", "<dtml-var phone>", "<dtml-var email>", "<dtml-var affiliation>", "<dtml-var question>", 'N', 'N', "") Peter Whysall wrote:
What's the best way of doing this?
I'm struggling to find any mention of the *current* date in the documentation; I've looked in the Zope DTML User's Guide and the Zope SQL Methods User's Guide.
regards
Peter.
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
-- -------------------------------------------------------------------- Rock and Rule Zope Rocks -- http://www.zope.org Python Rules -- http://www.python.org -------------------------------------------------------------------- Thomas McMillan Grant Bennett Appalachian State University Computer Consultant II University Library bennettt@am.appstate.edu http://www.library.appstate.edu/webmaster/ Voice: 828 262 6587 FAX: 828 262 3001 Windows 95 is a 32-bit extension to a 16-bit patch for an 8-bit operating system that was originally coded for a 4-bit microprocessor. - Chris Dunphy Boot Magazine
TMGB wrote:
Here is what I use to put the current date into a MySQL field: "<dtml-var ZopeTime fmt="19%y-%m-%d">" 1999-04-25
Um, is it just my imagination, or are you introducing a Y2k problem here? Isn't there a four digit year format string? Michael Bernstein. -------------------------------------- Michael Bernstein webmaven@lvcm.com FIAWOL {Fandom Is A Way Of Life} http://www.fiawol.com --------------------------------------
Actually ,though I may be wrong, I think this avoids a Y2k problem in that on January 1 I can change the SQL text from 19 to 20. Just now testing I find that %Y does give a four digit year and if I'm not mistaking this should be Y2K compliant because of Zope's compliancy. Had you not responded I probably wouldn't have given it another thought but instead now I don't have to remember to go back and switch 19 to 20. Thanx Thomas Michael Bernstein wrote:
TMGB wrote:
Here is what I use to put the current date into a MySQL field: "<dtml-var ZopeTime fmt="19%y-%m-%d">" 1999-04-25
Um, is it just my imagination, or are you introducing a Y2k problem here?
Isn't there a four digit year format string?
Michael Bernstein. -------------------------------------- Michael Bernstein webmaven@lvcm.com FIAWOL {Fandom Is A Way Of Life} http://www.fiawol.com --------------------------------------
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
-- -------------------------------------------------------------------- Rock and Rule Zope Rocks -- http://www.zope.org Python Rules -- http://www.python.org -------------------------------------------------------------------- Thomas McMillan Grant Bennett Appalachian State University Computer Consultant II University Library bennettt@am.appstate.edu http://www.library.appstate.edu/webmaster/ Voice: 828 262 6587 FAX: 828 262 3001 Windows 95 is a 32-bit extension to a 16-bit patch for an 8-bit operating system that was originally coded for a 4-bit microprocessor. - Chris Dunphy Boot Magazine
participants (4)
-
Michael Bernstein -
Peter Whysall -
TMGB -
Tony McDonald