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

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.