Date format conversion - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Date format conversion

enryenry Posts: 4Member
[b][red]This message was edited by enry at 2003-6-2 7:14:11[/red][/b][hr]
Dear All,

Does anyone know how to convert a date from format DD/MM/YYYY into format YYYY/MM/DD using Python in Zope?

I get a string date from an input box named EventDate which I then need to pass to a so that I can then convert its format. The lines of code I've wrotten give the errors below.

Please help me.
Thanks
Enry

1)

Error Type: TypeError
Error Value: __setitem__() got an unexpected keyword argument 'fmt'

2)

Expression (Python) Syntax error:
unexpected EOF while parsing

New findings:

The code I have found on Zope.org works ony if you accept in the imput box the american date format (MM,DD,YYYY) and not (DD,MM,YYYY).

In the form:


In the DTML method:


How do I change EventDate into the (DD,MM,YYYY) format?

Thanks a lot for your help.
Enrica

Comments

  • infidelinfidel Posts: 2,900Member
    : [b][red]This message was edited by enry at 2003-6-2 7:14:11[/red][/b][hr]
    : Dear All,
    :
    : Does anyone know how to convert a date from format DD/MM/YYYY into format YYYY/MM/DD using Python in Zope?
    :
    : I get a string date from an input box named EventDate which I then need to pass to a so that I can then convert its format. The lines of code I've wrotten give the errors below.
    :
    : Please help me.
    : Thanks
    : Enry
    :
    : 1)
    :
    : Error Type: TypeError
    : Error Value: __setitem__() got an unexpected keyword argument 'fmt'
    :
    : 2)
    :
    : Expression (Python) Syntax error:
    : unexpected EOF while parsing
    :
    : New findings:
    :
    : The code I have found on Zope.org works ony if you accept in the imput box the american date format (MM,DD,YYYY) and not (DD,MM,YYYY).
    :
    : In the form:
    :
    :
    : In the DTML method:
    :
    :
    : How do I change EventDate into the (DD,MM,YYYY) format?
    :
    : Thanks a lot for your help.
    : Enrica

    I haven't looked at Zope for months now and don't have time currently to install it and figure out this problem, but if I run across something, I'll post it here.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

Sign In or Register to comment.