PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
PEAR DATE Driving me nuts!

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Date & Time
View previous topic :: View next topic  
Author Message
briandumbledore



Joined: 29 Sep 2010
Posts: 1

PostPosted: Wed Sep 29, 2010 9:44 pm    Post subject: PEAR DATE Driving me nuts! Reply with quote

This is driving me nuts:
Code:

<?PHP
include "Date.php";

$datenow=new Date("2010-09-28T00:00:00-0400");
$datelater=new Date("2010-09-28T01:00:00-0400");
echo $datenow->getTime();
echo "<br/>";
echo $datelater->getTime();
echo "<br/>";
echo $datenow->before($datelater);
echo "<br/>";
$datenow=new Date("2010-09-28 00:00:00");
$datelater=new Date("2010-09-28 01:00:00");
echo $datenow->getTime();
echo "<br/>";
echo $datelater->getTime();
echo "<br/>";
echo $datenow->after($datelater);
echo "<br/>";
?>




The output is ridiculous:
1285646400
1285650000
1
1285646400
1285650000
1

Why is the behavior of before and after so???? Same with compare function. What am I missing? I am new to PEAR. I only installed PEAR thinking the date and time functions would save me time. But I already wasted alot of time making sense of this.

linux machine, default system timezone is EST5EDT
Back to top
View user's profile Send private message
Brentt



Joined: 05 Aug 2011
Posts: 1

PostPosted: Fri Aug 05, 2011 11:40 am    Post subject: Reply with quote

Laughing
_________________
business financing small
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Date & Time All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement