1 Reply Latest reply on Aug 15, 2006 5:15 AM by Chunick

    Adding days into the System/Current date

    farhanakhan Level 1
      I need to know how can i add 90 days into the system/current date??

      Let's say, today date is (08/15/2006) and now i want to add 90 into it, i tried to write the following:
      (08/15/2006)+90, but the result is weird, its giving me date.

      Any idea or any suggestions??

        • 1. Re: Adding days into the System/Current date
          Chunick Level 3
          try this in the Message window:

          put the systemDate
          -- date( 2006, 8, 15 )

          now, do this in the Message window:

          put the systemDate + 9
          -- date( 2006, 8, 24 )

          The systemDate returns a date object. If you need to get the date formatted into a string then all you need to do is this:
          someVar = the systemDate + 9
          someStr = string(someVar.day) & "/" & string(someVar.month) & "/" & string(someVar.year)

          ... or however you would like to format it. There may be a more direct way to format it, but I can't think of it right now.

          Also look into the date, the long date, the time and the long time. They're older version command which give you dates and times in strings, however their formats are dependent on the OS settings and they cannot be as easily manipulated as a date object can.

          if you're using MX2004 then you can create a moviescript which uses Javascript and use it's date function which will probably give you more control over the formatting/displaying of the date/time as well as other functions not available to Lingo.