3 Replies - 6850 Views - Last Post: 29 March 2010 - 12:06 AM Rate Topic: -----

#1 Tapas Bose  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 23
  • View blog
  • Posts: 472
  • Joined: 09-December 09

Date and Time Difference Calculator

Posted 28 March 2010 - 04:08 AM

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

Is This A Good Question/Topic? 0
  • +

Replies To: Date and Time Difference Calculator

#2 r.stiltskin  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1833
  • View blog
  • Posts: 4,927
  • Joined: 27-December 05

Re: Date and Time Difference Calculator

Posted 28 March 2010 - 09:13 AM

View PostTapas Bose, on 28 March 2010 - 07:08 AM, said:

... 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.
Was This Post Helpful? 0
  • +
  • -

#3 Tapas Bose  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 23
  • View blog
  • Posts: 472
  • Joined: 09-December 09

Re: Date and Time Difference Calculator

Posted 28 March 2010 - 09:29 AM

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.
  Or,
  The Difference is : 3652058 day 23 hour 59 minute 59 second.
  Or,
  The Difference is : 87649415 hour 59 minute 59 second.
  Or,
  The Difference is : 963997663 minute 59 second.
  Or,
  Difference is : 2005284991 second.


If you want to see the code. I can post it here.
Was This Post Helpful? 0
  • +
  • -

#4 Guest_Yannis*


Reputation:

Re: Date and Time Difference Calculator

Posted 29 March 2010 - 12:06 AM

[/code]
If you want to see the code. I can post it here.
[/quote]

yes,please.i would be grateful if you could post the code for this program.
Was This Post Helpful? 0

Page 1 of 1