Log in

View Full Version : An interactive calender



SirChick
06-10-2007, 06:56 PM
Hey im looking to make a calender in the format of:

Thursday, 19th of June 1980.

But i need one that does not follow the my pc clock. Let me explain. Im trying to make a website/game type of thing which starts in the 1800's. But when i make a clock using pc clock it displays modern day time.

Further to add, i need the time to be used in variables because some codes will be checking the in-game clock so it will know when to run certain blocks of php code etc.

Any one know how to do this ?

djr33
06-11-2007, 03:21 AM
timestamps are the number of seconds since 1970. We're at like 110000000 something now. Most computers/applications use timestamps to store data.

This presents a problem... you can't store 1800 in a system that starts at 1970.

So what I'd suggest is adjusting this in one of two ways:
1. You could just use normal timestamps and create a new way to parse them so that it's 1770 instead of 1970, and that should work.
Or,
2. You could parse the timestamp, get the year, then subtract ~200 from the year value, and you'd get June 10, 2007.... minus 200 years = June 10, 1807.

Or, just create your own system. Not sure what else to say.

You could use normal time and use differences from points in time (if you were on from 2pm to 4:30pm, that would be 2.5 hours), then just add those differences to your chosen starting time.