Date Comparison and Manipulation Functions?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • W. eWatson

    #16
    Re: Date Comparison and Manipulation Functions?

    John Machin wrote:
    On Aug 30, 10:41 am, "W. eWatson" <notval...@sbcg lobal.netwrote:
    >
    >What I'm trying to do is adjust date-time stamped file names for date and
    >time errors. The software program collects through a period that roughly
    >coincides with night hours every day and according to the OS clock. It
    >sometimes happens that a user sets the clock to the wrong day or hour,
    >possibly both. Possibly even the month or year. I'm trying to allow a user
    >the opportunity to repair the problem. (Date-time stamp part of the name is
    >yyyymmdd_hhmms s.) Correcting the date needs to be done easily and
    >accurately. For example, if on August 25, he mistakenly sets the date to
    >July 25, and discovers this problem on the real Oct. 5, he should be able to
    >shift all dates from July 25 through Sept. 5 to Aug. 25 through early Oct.,
    >allowing for day oddities in a month during the period. (I hope I got those
    >dates right; otherwise, I think you get the idea. In other words, he needs
    >to shift about 40 days of data to the correct dates.)
    >
    ... all of which is absolutely nothing to do with your surprise at the
    result of whatever.plus(m onths=6).
    Really? It opened new insights for me. The example above is not the only
    correction I need to deal with. Further, the author is likely to soon
    clarify some of the date rules in the tutorial that were not obvious nor
    mentioned there.
    >
    So for some period from recorded date X to recorded date Y, the
    recorded dates of out of kilter by D days. X = Jul 25 2008, Y Sep 5
    2008, and D is 31 (days from Jul 25 to Aug 25). All you have to do is
    (pseudocode):
    >
    if X <= recorded_date <= Y:
    new_recorded_da te = recorded_date.p lus(days=D)
    >
    HTH,
    John
    >

    --
    W. Watson
    (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
    Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

    Comment

    • W. eWatson

      #17
      Re: Date Comparison and Manipulation Functions?

      The author has updated the Tutorial and added a flex method.

      Comment

      Working...