Announcement

Collapse
No announcement yet.

Date/Time differences

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Date/Time differences

    In power basic for Dos, how does one perform date/time
    calculations?

    For example, can I:
    Tyme1$=15:30:45
    Tyme2$=13:22:05

    Tyme3$=Tyme1$-Tyme2$
    How can I get Tyme3$ to equal 01:08:40 ?

    Same deal with dates?
    Dayte1$=20030215 :'format YYYYMMDD
    Dayte2$=20030101
    Dayte3$=Dayte1$-Dayte2$
    I would like for Dayte3$ to equal 14 days in some fashion. Is
    this possible? I have pulled out about a handful of hair to
    make this work.

    This is for employee time clock funtions and calculating
    interest.

    Thank you.

    Robert

    ------------------

    #2
    robert,
    this posting, although initially designed with the windows compiler in mind, still gives everything you need to do what you want.

    easter calculation

    regards,

    ------------------
    [email protected]
    :) IRC :)

    Comment


      #3
      See DateUnit.bas in your PBDOS35\Examples directory.

      ------------------
      Tom Hanlin
      PowerBASIC Staff

      Comment


        #4
        Tom- well, I will be.... I +do+ have it.

        I guess at some point in time, the Examples directory was
        deleted. I found it by reinstalling PB for dos.

        Thanks.

        Robert

        ------------------

        Comment


          #5
          Tom-

          Whups, I see in the Dateunit.bas the dates should be between
          01-01-1900 and 06-05-2079.

          Uh, what would be involved in making that 01-01-1400?!?

          Reason: I am a family genealogist, and my oldest person is 1504,
          and I hope to go even before that.

          I bet your answer is "no earthly way!," but if it can be done at
          all, I would appreciate knowing how. 100 percent precision
          accuracy is not mandatory- the information I have might be a
          month off.

          I am aware of the Calendar conversion problems, but I try to
          convert all dates to the present calendar system.

          Thank you.

          Robert

          ------------------

          Comment


            #6
            It probably wouldn't be difficult to change the starting point but,
            I don't know the qualifications offhand. It's not completely arbitrary.

            You might check out other solutions in the Download area here.
            http://www.powerbasic.com/files/pub/pbdos/library/

            Egbert Zijlema has also done some good work with date handling:
            http://zijlema.basicguru.com/

            ------------------
            Tom Hanlin
            PowerBASIC Staff

            Comment


              #7
              i just posted some date code here. i think it will still work for dos. if not, give me a shout and i'll root around for the dos version.
              http://www.powerbasic.com/support/pb...ead.php?t=7522

              ------------------
              c'ya
              d83
              C'ya
              Don

              http://www.ImagesBy.me

              Comment

              Working...
              X
              😀
              🥰
              🤢
              😎
              😡
              👍
              👎