Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    California, USA

    Number of seconds since a date out of timestamp range

    I'm trying to accurately, to the second, find the time that has passed since a date in the year 1750 to the present. This may seem easy, but the platform I'm working on is using signed 32-bit integers to store timestamps, so I can't accurately count seconds for dates prior to 1901. Or maybe I can, how would you go about doing this? Am I going to have to write some kind of hacky function that counts recursively and takes into consideration leap years and such?
    Last edited by etogre; 09-27-2009 at 08:05 PM.

  2. #2
    Join Date
    Feb 2005
    One particular date in 1750 or any date during that year? If the former, just calculate (once) the offset between that date and Jan 01, 1901 (or wherever your timestamp starts). If it's any date in 1750 do the same but from Jan 01, 1750 and calculate an additional offset for the day of the year.

    The real issue here is the calendar changes that have happened between then and now, but presumably if you can find the right records you should be able to allow for these in your one-off calculations.

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  3. #3
    Join Date
    Jan 2002
    I've had this issue as well (with years beyond 2130) but with php and since you're not saying what language you are using I'm going to throw in a php suggestion.

    You can use ADOdb Date Time library which works with dates well beyond the "standard" php date() function. syntax and inputs are the same as the php counterparts so it makes adapting your current code simple.

    If you are not using php, I apologize. I cant offer any suggestions otherwise.

Similar Threads

  1. PCRE Regular Expression - Number Range?
    By akasixcon in forum Programming Discussion
    Replies: 12
    Last Post: 12-27-2006, 09:27 PM
  2. Cpanel Version Number and last date of updates????
    By mouseattack in forum Hosting Security and Technology
    Replies: 4
    Last Post: 03-23-2005, 11:08 AM
  3. Drop date & whois date different... which is accurate?
    By NightProwler in forum Domain Names
    Replies: 2
    Last Post: 08-21-2004, 05:30 AM
  4. PHP + mySQL: How to search for a number range?
    By hdezela in forum Programming Discussion
    Replies: 3
    Last Post: 05-22-2003, 07:40 AM
  5. How would I do this? adding a number to part of a string (date).
    By MGCJerry in forum Programming Discussion
    Replies: 3
    Last Post: 04-29-2003, 10:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts