Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


online Timer

Posted on 1998-08-16
Medium Priority
Last Modified: 2010-04-04
I need a online timer algorithm that calculates the time zone i am in and works out a cost for that second, it is for a program that claculates the online time spent on the internet and gives a real time cost per second, it is for a school project i have to give in soon, pleeeeasssseeee help. It should give the duration and the total cost for that time worked out by the second. Please mail me
Question by:dapple
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3

Accepted Solution

ZifNab earned 200 total points
ID: 1335529

Author Comment

ID: 1335530
Zifnab you misunderstood This does not answer my question
i mean i want to work out the amount of time i have spent onlne
and a cost per second in real time for that duration. I need to know which time zone i am in i.e 08:00 - 18:00 peak rate or
18:00 - 8:00 evening rate, this should be calculated every sec
then charge an amount for that second. So it will give a start time for the call a duration and a cost every second.

Expert Comment

ID: 1335531

Ok, then what do you already know.

Do you have some strategy? What values are user put-ins? Are the time-zones entered by the user? What do you need to know, without  input from the user.

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 1335532
The user inputs the peak start time and finish time e.g.
08:00 - 18:00 also the cost per min for each period peak, evening, weekend e.g 3 pence/min. The app then gives the start time when the DUN starts a duration since the start and the current cost using the value the user entered. I want to know the algorithm for working this cost out.
I tried increment a variable every sec to represent the number of seconds in each time zone e.g.
18:00 - 23:59 inc(daysec) then use the number of secs to work the cost but this was not accurate i need to use the start time and endtime to work it. How would you go about it?

Expert Comment

ID: 1335533
? dapple, I think I still don't fully understand your problem.
Why not using the Time function which returns the current time?

1. When DUN starts, put the current time in a variable, look in which time-period you are
2. Then get your new time (every second in your case), look in which time-period you are for this new time.
 - in the same  : (TimeNew-TimeStart) in minutes * money = ...
 - in different : First calculate the previous cost
                  + New cost, because new time-period.



Am I missing something?

Author Comment

ID: 1335534
ok no problem i will try and work it thanks for your time

Expert Comment

ID: 1335535
dapple, you didn't have to accept my answer already, first try it out!! Zif. Let me know when you've some problems.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question