Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-05-2008, 04:50 PM
Junior Member
 
Join Date: May 2008
Posts: 4
Default Zend_Date bug?

hello,

there is a strange behaviour of Zend_Date...

Code:
$date1 = array('year' => '2008', 'month' =>'4', 'day' =>'13', 'hour' => '10', 'minute' =>'45', 'second' => '12');
$show_date1 = new Zend_Date($date1);
echo $show_date1;

//returns: 2008-04-13 10:45:12
but
Code:
$date2 = array('year' => '2008', 'month' =>'4', 'day' =>'13', 'hour' => '23', 'minute' =>'45', 'second' => '12');
$show_date2 = new Zend_Date($date2);
echo $show_date2;

//returns: 2008-04-14 23:45:12
if 'hour' >= '22'
'day' = 'day' + 1

can anyone tell me something about this?

Code:
echo Zend_Version::VERSION;

//returns: 1.5.1
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-08-2008, 12:57 PM
Junior Member
 
Join Date: Jan 2008
Posts: 1
Default

Hi!

I know this doen't help but I have the same problem. I just can't find the code anymore. I had to subtract one hour to get to correct date. Zend_Date is a monster!

I think my problem was, that I reused the same Zend_Date object (which isn't the case in your example) and forgot to level the time correctly.

When I find my code I'll post it here.

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-12-2008, 06:53 PM
Ewok's Avatar
Junior Member
 
Join Date: Mar 2008
Location: Colorado SPrings
Posts: 16
Send a message via MSN to Ewok Send a message via Yahoo to Ewok
Default

Yet more unhelpfulness. I was calculating the last day of the month, so I picked the first day added a month and subtracted a day. Unless the month had 31 days, it would return the day as 32.

I changed tack and used the MONTH_DAYS instead, which works better for what I need, but If I needed to calculate yesterday from the start of a month, no worky.

Framework was version 1.5 when I tried it.
__________________
Give all victory and gain to others
Take all defeat and loss upon yourself
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:45 AM.