List Info

Thread: Zend_Date help




Zend_Date help
user name
2008-05-28 04:11:19
Hi,

I try to convert a string representing a date into a zend
date object.
(It is the format date returned by paypal)

	$zd = new Zend_Date("18:30:30 Jan 1, 2000 PST",
'H:m:s MM.dd.yyyy');
	echo  $zd->get('YYYY-MM-dd H:m:s');

This prints:  1975-06-23 18:30:30
So the year, month and date are wrong.

Thank you for any help !
-- 
View this message in context: http://www.nabble.com/Zend_Date-help-tp17508292p175
08292.html
Sent from the Zend Framework mailing list archive at
Nabble.com.


Re: Zend_Date help
user name
2008-05-28 07:33:41
Now I finally got it working, since I specified locale
'en_US'
Probably it didn't recognize 'Jan', I think there should be
an exception in
such cases.



debussy007 wrote:
> 
> Hi,
> 
> I try to convert a string representing a date into a
zend date object.
> (It is the format date returned by paypal)
> 
> 	$zd = new Zend_Date("18:30:30 Jan 1, 2000",
'HH:mm:ss MMM d, YYYY');
> 	echo  $zd->get('YYYY-MM-dd H:m:s');
> 
> This prints:  1975-06-23 18:30:30
> So the year, month and date are wrong.
> 
> Thank you for any help !
> 

-- 
View this message in context: http://www.nabble.com/Zend_Date-help-tp17508292p175
11620.html
Sent from the Zend Framework mailing list archive at
Nabble.com.


Re: Zend_Date help
user name
2008-05-28 08:53:32
Why should there be an exception...
Looking into the doc it says that IF YOU SUPRESS THE LOCALE
it will 
autodetect it, which means that it uses the one from your
browser or from 
your server.

Only when no locale can be detected there will be an
exception thrown.

Greetings
Thomas
I18N Team Leader

----- Original Message ----- 
From: "debussy007" <debussy007gmail.com>
To: <fw-generallists.zend.com>
Sent: Wednesday, May 28, 2008 2:33 PM
Subject: Re: [fw-general] Zend_Date help


>
> Now I finally got it working, since I specified locale
'en_US'
> Probably it didn't recognize 'Jan', I think there
should be an exception 
> in
> such cases.
>
>
>
> debussy007 wrote:
>>
>> Hi,
>>
>> I try to convert a string representing a date into
a zend date object.
>> (It is the format date returned by paypal)
>>
>> $zd = new Zend_Date("18:30:30 Jan 1,
2000", 'HH:mm:ss MMM d, YYYY');
>> echo  $zd->get('YYYY-MM-dd H:m:s');
>>
>> This prints:  1975-06-23 18:30:30
>> So the year, month and date are wrong.
>>
>> Thank you for any help !
>>
>
> -- 
> View this message in context: 
> http://www.nabble.com/Zend_Date-help-tp17508292p175
11620.html
> Sent from the Zend Framework mailing list archive at
Nabble.com. 


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )