• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

  • 0
Sign in to follow this  

Calculate time in seconds between now and Friday at 5pm

Question

generalt    0

I have a countdown timer on my website that needs the time in seconds between the current time and a certain date, say, next Friday at 5pm. The calculation needs to be made just once -- after a user loads the page the PHP needs to calculate the time in seconds and the Javascript will count down after that. How exactly do I get PHP to do this?

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0
snaphat (Myles Landwehr)    414

Use gmmktime() to standardize the time retrieved to GMT

Share this post


Link to post
Share on other sites
  • 0
generalt    0

Thanks -- not sure how I didn't find that thread before.

Share this post


Link to post
Share on other sites
  • 0
generalt    0

How do I get this to work across timezones? I want it to count down to a certain date in eastern time.

Share this post


Link to post
Share on other sites
  • 0
Hum    6,933

Why ?   Just Why ? :huh:

Share this post


Link to post
Share on other sites
  • 0
generalt    0

Use gmmktime() to standardize the time retrieved to GMT

 

Thanks!

Share this post


Link to post
Share on other sites
  • 0
generalt    0

Why ?   Just Why ? :huh:

 

 

LOL. I have a deal on my site that expires for all users at a certain time. It'd be pretty difficult for me to end the deal separately for each time zone...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.