I am writing a code whose job is to calculate difference between two given date and time. The format will be
YYYY:MM:DD:hh:mm:ss, ISO standard. As Gregorian Calendar proclaimed in 1582, what will be the lower limit of year, year 0001? I set the upper limit of year as year 9999.
This post has been edited by Tapas Bose: 28 March 2010 - 04:10 AM
... what will be the lower limit of year, year 0001?
Doesn't that depend on the intended use of the program? If the user needs to deal with events in, say, the Roman Empire or the medieval period then you should write code that is able to handle the Gregorian transition, but if the user will only be dealing with modern times that would be a waste of effort.
Thank you. I understand your point. Following is a sample output of my code :
Date and Time difference calculator.
Format : YYYY:MM:DD:hh:mm:ss.
Range : 0001:01:01:00:00:00 - 9999:12:31:23:59:59.
Enter From Date : 0001:01:01:00:00:00
Enter To Date : 9999:12:31:23:59:59
The Difference is : 521722 weak 4 day 23 hour 59 minute 59 second.
The Difference is : 3652058 day 23 hour 59 minute 59 second.
The Difference is : 87649415 hour 59 minute 59 second.
The Difference is : 963997663 minute 59 second.
Difference is : 2005284991 second.