Advertisement

04.12.2008 at 08:11AM PDT, ID: 23317410
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Urgent: Time and Date calculations.

Tags: Borland C++ Builder 6
Hi,

Since I am creating (atleast trying) a trail version of my software, I am concerned about the time and date parameters.
The user can simply turn his bios or windows clock back and still use the software if using time() or any other functions which are provided by Borland.

To avoid this I decided to get the current time from the time servers.
My current result is the current time (year,month,day,hour,minute,second) stored in different integers.

The main problem of mine is the calculation if the year has changed. For example if the program was started using at 21 of December, 2008 and the current date is 2 January 2009 and the trail period is 30 days the program should still stay active. Also there is alot of problems with february which has a different day count every 4 years and so on. Also every second month has different ammount of days in  it,also daylight saving and other factors.

Well the daylight saving is the last thing to worry about. I'll give away that one free hour :).

I could use time(0) difftime() functions to calculate the correct difference (I hope that they will be correct), but first I have to understand how to convert the current date and the trail start date to the format which uses 1970 01 01 00:00 as the start of calculation. Then understand how to turn the difference of time since that date to seconds. Calculating it would also be a problem because of the February.

Since the program will only be a three day trail the miscalulations of february could turn up a disaster which could end up a 20 or more day trail instead of 3.

Also readed about the Julian Time format, but I'm not sure if it suits my needs.

I saw an object called DateTime in .NET which would solve all my problems. Maby there is something similar in C++/Borland C++?
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: Jammer1224
Solution Provided By: ozo
Participating Experts: 1
Solution Grade: B
Views: 43
Translate:
Loading Advertisement...
04.12.2008 at 08:40AM PDT, ID: 21341543

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.12.2008 at 08:46AM PDT, ID: 21341569

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.12.2008 at 08:53AM PDT, ID: 21341589

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_2_20070628