DateTime is build upon the GNU standard.
Zend_Date is build upon the ISO standard.
For now not all date-relativ entities are supported.
The main reason is that they can not be given localized.
A german user would want to write "letzter Sonntag" but we have no
localizations for date-relativ verbs.
On the other hand would Zend_Date throw an exception if a german user wants
to set "Sunday"
instead of "Sonntag" if he did not get the locale properly.
Things like "last november", "months ago", "this year" and so on
are actually not avaiable.
If you think this is a must just add an jira issue and we will look how many
people are in use of this.
My opinion is that such things can be implemented very easy with existing
code as you already showed.
PS: We did not focus on doubling existing code... we looked for
simplification and additional functionality.
Greetings
Thomas
I18N Team Leader
----- Original Message -----
From: "Karol Grecki" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, May 25, 2007 12:21 PM
Subject: [fw-general] Zend_Date vs. DateTime
I want to start using Zend_Date for it's extra functionality compared to
DateTime.
But with DateTime I'm able to do:
$end = new DateTime('last Sunday');
$start = clone $end;
$start->modify('last Monday');
$end->setTime(23, 59, 59);
This gives me beginning and end of last week. I don't see strtotime()
functionality in Zend_Date, did I miss something?
Do I have to do?:
$start = new Zend_Date();
$start->subWeek(1);
$start->setWeekday(1);
$start->setTime('00:00:00');
$end = clone $start;
$end->setWeekday(7);
$end->setTime('23:59:59');
Cheers
Karol
--
View this message in context:
http://www.nabble.com/Zend_Date-vs.-DateTime-tf3815303s16154.html#a10800411
Sent from the Zend Framework mailing list archive at Nabble.com.