Countdown between two dates

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

If your overall value is not changing that means that the two values fed to it did change or they are changing simultaneously and in the same increment.
NiGHTFiRE
Forum Contributor
Posts: 156
Joined: Sun May 14, 2006 10:36 am
Location: Sweden

Post by NiGHTFiRE »

well the two dates have 1 month apart from each other :/ so they dont change. one is 2006-09-01 15:47:31 and the other one 2006-08-01 15:47:31
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

so why would you expect the difference between the dats to change :s
NiGHTFiRE
Forum Contributor
Posts: 156
Joined: Sun May 14, 2006 10:36 am
Location: Sweden

Post by NiGHTFiRE »

I thought that it would show how long it was untill that date.. So like now, it woudn't say 744 hours left. it would say a lower value.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

The difference between 2 dates that are 1 month apart, no matter what dates they are, will always be the same!?

Am i missing something?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I was kinda thinking the same thing...

Code: Select all

3-2 = 1 ALWAYS...
NiGHTFiRE
Forum Contributor
Posts: 156
Joined: Sun May 14, 2006 10:36 am
Location: Sweden

Post by NiGHTFiRE »

Okey, i probably explained what i meant poorly. I've got one date that a membership should stop at. And one date where the membership starts at. I want so the member can see how long he has his membership untill it expires.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

So the membership start date has nothing to do with your script. You want ENDDATE - NOW. Try that in your script logic and see what you come up with.
NiGHTFiRE
Forum Contributor
Posts: 156
Joined: Sun May 14, 2006 10:36 am
Location: Sweden

Post by NiGHTFiRE »

lol, yeah pretty smart :P
Post Reply