Date formatting

classic Classic list List threaded Threaded
6 messages Options
Muon Thi Van Muon Thi Van
Reply | Threaded
Open this post in threaded view
|

Date formatting

I want to change a date in the form of 2005/05/11 to the form May 11,
2005. However, when I use the function

python:here.toLocalizedTime(my_date, long_format='%B %d, %Y')

I get the date in this format: 2005-11-01 12:00 AM

Anybody know why?

Thanks.


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Plone-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Luca Olivetti-4 Luca Olivetti-4
Reply | Threaded
Open this post in threaded view
|

Re: Date formatting

En/na Muon Thi Van ha escrit:
> I want to change a date in the form of 2005/05/11 to the form May 11,
> 2005. However, when I use the function
>
> python:here.toLocalizedTime(my_date, long_format='%B %d, %Y')
>
> I get the date in this format: 2005-11-01 12:00 AM
>
> Anybody know why?

long_format is just a boolean to decide if you want to show just the
date or the date and time.
You either have to use strftime instead of toLocalizedTIme or define a
different translation for date_format_long for your language in
PloneTranslations

Bye

--
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004      Fax +34 93 5883007


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Plone-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Muon Thi Van Muon Thi Van
Reply | Threaded
Open this post in threaded view
|

Re: Date formatting

In reply to this post by Muon Thi Van
I want to change a date in the form of 2005/05/11 to the form May 11,
2005. However, when I use the function

python:here.toLocalizedTime(my_date, long_format='%B %d, %Y')

I get the date in this format: 2005-11-01 12:00 AM

Anybody know why?

Thanks.


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Plone-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Muon Thi Van Muon Thi Van
Reply | Threaded
Open this post in threaded view
|

Re: Date formatting

In reply to this post by Muon Thi Van
I want to change a date in the form of 2005/05/11 to the form May 11,
2005. However, when I use the function

python:here.toLocalizedTime(my_date, long_format='%B %d, %Y')

I get the date in this format: 2005-11-01 12:00 AM

Anybody know why?

Thanks.


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Plone-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Uwe C. Schroeder Uwe C. Schroeder
Reply | Threaded
Open this post in threaded view
|

Re: Re: Date formatting


Plone has a portal default setting for the date format (long and short) to use
in the portal_properties/site_properties area.
Just change that to whatever you want and all date/times in the portal will
adhere to it - also toLocalizedTime()


On Thursday 20 October 2005 20:54, Muon Van wrote:

> I want to change a date in the form of 2005/05/11 to the form May 11,
> 2005. However, when I use the function
>
> python:here.toLocalizedTime(my_date, long_format='%B %d, %Y')
>
> I get the date in this format: 2005-11-01 12:00 AM
>
> Anybody know why?
>
> Thanks.
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Plone-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/plone-users

--
        UC

--
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone:  +1 650 872 2425 San Bruno, CA 94066
Cell:   +1 650 302 2405 United States
Fax:    +1 650 872 2417


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Plone-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Luca Olivetti-4 Luca Olivetti-4
Reply | Threaded
Open this post in threaded view
|

Re: Re: Date formatting

En/na Uwe C. Schroeder ha escrit:
> Plone has a portal default setting for the date format (long and short) to use
> in the portal_properties/site_properties area.
> Just change that to whatever you want and all date/times in the portal will
> adhere to it - also toLocalizedTime()

Only if there's no translation in PloneTranslations.

Bye

--
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004      Fax +34 93 5883007


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Plone-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users