SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old August 12th, 2004, 05:34 AM
Alicia Alicia is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 116 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 m 49 sec
Reputation Power: 5
create timer

Hi guys,

I want to offer something to my clients for a limited time only and i want to let them know the time left before the promotion end... assuming that the last day for the offer is 20 of aug 2004, how can I set a program so that we can tell people how many days and hours left for them to take action?

i tried js but it doesn't seem to work coz the js will only runs when people load the page and the timer will shows different time on other computers if they access different time.. i want all people to view the same time left no matter where and when they view it,,, something like the timer auction websites have.

please advise..

Reply With Quote
  #2  
Old August 12th, 2004, 06:35 AM
Itsacon's Avatar
Itsacon Itsacon is offline
Command Line Warrior
Click here for more information
 
Join Date: Aug 2004
Location: Sector ZZ9 Plural Z Alpha
Posts: 956 Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 672951 Folding Title: Super Ultimate Folder - Level 2Folding Points: 672951 Folding Title: Super Ultimate Folder - Level 2Folding Points: 672951 Folding Title: Super Ultimate Folder - Level 2Folding Points: 672951 Folding Title: Super Ultimate Folder - Level 2Folding Points: 672951 Folding Title: Super Ultimate Folder - Level 2Folding Points: 672951 Folding Title: Super Ultimate Folder - Level 2Folding Points: 672951 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 6 Days 8 h 23 m 32 sec
Reputation Power: 4
Send a message via ICQ to Itsacon
PHP Code:
 $enddate mkdate(0,0,0,8,20,2004);  #enddate of action, is variable so you can easily get it from a database or so.

$curdate mkdate();   #current date

$diff $enddate $curdate;

$diffdays floor($diff/86400);   #get days to end of action
$diffhours round(($diff%86400)/3600);   #get hours to end of action 


Hope this helps

PS: If you like that more, you can use the strtotime() function instead of mktime:
PHP Code:
 $enddate strtotime("20 aug 2004"); 

You should however first test whether strtotime() accepts your string format.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > create timer


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway