Page 1 of 1
Regarding date and time
Posted: Sat May 31, 2008 5:01 am
by mabus
Hello,
I am looking for some tutorials on how to calculate date / time on php, that utilizes the date object.
For a while, I have been using date(), and strtotime() to come up with dates, but doing calculation and comparing the outputs from those means string comparisson, which is not what I want.
Can you point out some tutorials or links where I can get some samples on using date object ot be able to calculate or comapre dates?
thanks in advance
Re: Regarding date and time
Posted: Sat May 31, 2008 1:37 pm
by Mr.RED
Hard to tell what you mean but have been using dates in the format of "DD-MM-YYYY" for example? Try using timestamps instead which makes it much easier to compare dates.
Re: Regarding date and time
Posted: Sat May 31, 2008 1:53 pm
by nowaydown1
Re: Regarding date and time
Posted: Sat May 31, 2008 10:45 pm
by mabus
Mr.RED wrote:Hard to tell what you mean but have been using dates in the format of "DD-MM-YYYY" for example? Try using timestamps instead which makes it much easier to compare dates.
hhmm.. this is actually what I considered as my last resort. I don't know if there are any other ways besides time stamps, but I'm open to this idea . Well, what I meant was , I'm using the date() method of php to be able to compu with dates that I compare. Now, since date() returns a string, then that means that the comparing is basically string comparison. What I want to get, is a comparison of dates, as if they are really date variables or date objects.
hhhmm.. are they using the native php date object, or do they have a library of some sort that has dates? I am current using another framework right now. I'm not sure if I wanna transfer it to zend.
Re: Regarding date and time
Posted: Sun Jun 01, 2008 4:23 pm
by califdon
There's really a world of information available on date comparisons. Like
http://www.phpf1.com/tutorial/php-date-compare.html
Try Googling it.