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
Regarding date and time
Moderator: General Moderators
Re: Regarding date and time
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.
-
nowaydown1
- Forum Contributor
- Posts: 169
- Joined: Sun Apr 27, 2008 1:22 am
Re: Regarding date and time
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.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.
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.nowaydown1 wrote:Zend Framework has a Date object:
http://framework.zend.com/manual/en/zend.date.html
Re: Regarding date and time
There's really a world of information available on date comparisons. Like http://www.phpf1.com/tutorial/php-date-compare.html
Try Googling it.
Try Googling it.