Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Tonic151

Time / Date Tracking

This topic is 5650 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Well i've never tried this, so i figured i'd get some info on the best technique for Time/Date Tracking... I'm going to be reading a bunch of log files with time and date stamps in them.. I want to pick out the time and date, and sort each Log line by day.. then seperate by each day of the month. And also have options to purge after x amount of days. Anways is there is easy way to go about this, the courius problem i was thinking i was going to run into for example: if i keep track of statistics, and have it where the "end user" can set how many days they would like the program to keep track of everything for.. example 7 days.. and it starts off on 11/28/02 and goes till 12/05/02, whould I have to make my own calander to keep track of the roll over for each month. Or is there something that already does this?? I'm also trying to think of the best way to store the date and time in a struct.. for comparision and subtracting / dividing time... any suggestions would help a lot.. i'm trying to keep this cross platform for linux as well... [edited by - tonic151 on December 3, 2002 5:20:29 PM]

Share this post


Link to post
Share on other sites
Advertisement
I don''t know if there is such a thing as a calender or something, but the best way to store date in my opinion is unix style. It''s used in databases.

(from MySQL documentation)

TIMESTAMP(14) YYYYMMDDHHMMSS
TIMESTAMP(12) YYMMDDHHMMSS
TIMESTAMP(10) YYMMDDHHMM
TIMESTAMP(8) YYYYMMDD
TIMESTAMP(6) YYMMDD
TIMESTAMP(4) YYMM
TIMESTAMP(2) YY

You can then format your date the way you want to show it to your player.

Hope this helps.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!