Based on Jan.1st,2000 00:00:00,you can enter a number(means the seconds) to calculate any date of recent years.For example:When you enter"-1",it outputs Dec.31st,1999 23:59:59.
If I want to calulate the date before Christ,how can I do that?
Are you having problems with some part of the algorithm in particular, or is this a general question question?
By the way, between 2000-01-01 00:00:00 and 0001-01-01 00:00:00 there's over 63*109 (1999*365.2425*86400) seconds, so you'll have to take that into account when deciding how to store the number of seconds.