Loading ...
Sorry, an error occurred while loading the content.
 

Re: [Clip] Entering a different date

Expand Messages
  • hsavage
    ... Lee, I should have read ahead, how about a couple of specific examples? Will the future date be fixed for a certain time span in the future or will it be
    Message 1 of 9 , Aug 4 1:50 PM
      Lee Underwood wrote:
      > Thanks, but I can get the current date. I need to know how to enter a
      > future date and then display it in the different formats I listed.
      >
      > Lee
      >
      >
      > On 8/4/2006 03:57 PM, Jeff Scism wrote:
      > ........................................................
      >
      >> ^!ClearVariables
      >>
      >> ^!Set %date1%=^$GetDate(dddd)$
      >> ^!Set %date2%=^$GetDate(mmmm)$
      >> ^!Set %date3%=^$GetDate(dd)$
      >> ^!Set %date4%=^$GetDate(yyyy)$
      >> ^!Set %hours%=^$GetDate(hh)$
      >> ^!Set %mins%=^$GetDate(nn)$
      >> ^!InsertText ^%date1%, ^%date2% ^%date3%, ^%date4%, ^%hours%:^%mins%
      >>
      >> ~~
      >>
      >> Jeffery Scism,

      Lee,

      I should have read ahead, how about a couple of specific examples?

      Will the future date be fixed for a certain time span in the future or
      will it be set on the spur of the moment?

      You may have to do some date-calcs.

      ºvº
      06.08.04_15.31
      "Chaos, Panic, & Disorder - My work here is done."
      hrs ø hsavage@...
    • Lee Underwood
      I have an .INI file that creates files for future posting. I just basically need a clip that asks What will the date be? and then format it into the three
      Message 2 of 9 , Aug 4 1:55 PM
        I have an .INI file that creates files for future
        posting. I just basically need a clip that asks
        "What will the date be?" and then format it into
        the three different formats. It doesn't need to
        be run more than once during a session.

        Lee


        On 8/4/2006 04:50 PM, hsavage wrote:
        ........................................................

        >Lee,
        >
        >I should have read ahead, how about a couple of specific examples?
        >
        >Will the future date be fixed for a certain time span in the future or
        >will it be set on the spur of the moment?
        >
        >You may have to do some date-calcs.
        >
        > ºvº
        > 06.08.04_15.31
        > "Chaos, Panic, & Disorder - My work here is done."
        > hrs ø hsavage@...
        >
        >
        ........................................................
      • John Zeman
        ... Here ya go mate. I can t take credit for this clip however, the main engine that parses the date you enter was written by Steve Veltkamp several years
        Message 3 of 9 , Aug 4 5:31 PM
          --- In ntb-clips@yahoogroups.com, Lee Underwood <leeu@...> wrote:
          >
          > I just basically need a clip that asks
          > "What will the date be?" and then format it into
          > the three different formats. It doesn't need to
          > be run more than once during a session.
          >
          > Lee
          >
          >



          Here ya go mate. I can't take credit for this clip however, the main
          engine that parses the date you enter was written by Steve Veltkamp
          several years ago. To this day I use it all the time for needs such
          as yours.

          You should be able to adapt it to the format you need.

          John



          ;begin clip to insert any date in long form

          ^!Set %indtg%=^?{(M="00/00/0000;1;*")Enter Date (mm/dd/yyyy)}
          ^!Set %y%=^$StrCopy(^%indtg%;7;4)$
          ^!Set %m%=^$StrCopy(^%indtg%;1;2)$
          ^!Set %d%=^$StrCopy(^%indtg%;4;2)$

          ^!If ^%m%<3 z1
          :z
          ^!Set %z%=^%y%
          ^!Goto calc
          :z1
          ^!Set %z%=^$CALC(^%y%-1)$
          :calc
          ^!Set %z4%=^$CALC(^%z%/4;3)$
          ^!Set %iz4%=^$CALC(INT(^%z4%))$
          ^!Set %z100%=^$CALC(^%z%/100;3)$
          ^!Set %iz100%=^$CALC(INT(^%z100%))$
          ^!Set %z400%=^$CALC(^%z%/400;3)$
          ^!Set %iz400%=^$CALC(INT(^%z400%))$
          ^!Set %m23%=^$CALC(^%m%*23)$
          ^!Set %m9%=^$CALC(^%m23%/9;3)$
          ^!Set %im9%=^$CALC(INT(^%m9%))$
          ^!If ^%m%<3 DOW1
          :DOW
          ^!Set %dow%=^$CALC(^%im9%+^%d%+4+^%z%+^%iz4%-^%iz100%+^%iz400%-2)$
          ^!Set %day%=^$CALC(^%dow%MOD7)$
          ^!Goto Weekday
          :DOW1
          ^!Set %dow%=^$CALC(^%im9%+^%d%+4+^%z%+^%iz4%-^%iz100%+^%iz400%+1)$
          ^!Set %day%=^$CALC(^%dow%MOD7)$
          ^!if ^%m%=01 ^!Set %month%="January"
          ^!if ^%m%=02 ^!Set %month%="February"
          ^!if ^%m%=03 ^!Set %month%="March"
          ^!if ^%m%=04 ^!Set %month%="April"
          ^!if ^%m%=05 ^!Set %month%="May"
          ^!if ^%m%=06 ^!Set %month%="June"
          ^!if ^%m%=07 ^!Set %month%="July"
          ^!if ^%m%=08 ^!Set %month%="August"
          ^!if ^%m%=09 ^!Set %month%="September"
          ^!if ^%m%=10 ^!Set %month%="October"
          ^!if ^%m%=11 ^!Set %month%="November"
          ^!if ^%m%=12 ^!Set %month%="December"
          :Weekday
          ^!if ^%m%=01 ^!Set %month%="January"
          ^!if ^%m%=02 ^!Set %month%="February"
          ^!if ^%m%=03 ^!Set %month%="March"
          ^!if ^%m%=04 ^!Set %month%="April"
          ^!if ^%m%=05 ^!Set %month%="May"
          ^!if ^%m%=06 ^!Set %month%="June"
          ^!if ^%m%=07 ^!Set %month%="July"
          ^!if ^%m%=08 ^!Set %month%="August"
          ^!if ^%m%=09 ^!Set %month%="September"
          ^!if ^%m%=10 ^!Set %month%="October"
          ^!if ^%m%=11 ^!Set %month%="November"
          ^!if ^%m%=12 ^!Set %month%="December"
          ^!if ^%day%=0 ^!Set %day%="Sunday"
          ^!if ^%day%=1 ^!Set %day%="Monday"
          ^!if ^%day%=2 ^!Set %day%="Tuesday"
          ^!if ^%day%=3 ^!Set %day%="Wednesday"
          ^!if ^%day%=4 ^!Set %day%="Thursday"
          ^!if ^%day%=5 ^!Set %day%="Friday"
          ^!if ^%day%=6 ^!Set %day%="Saturday"


          ^!InsertText ^%day%, ^%month% ^%d%, ^%y%
        • abairheart
          Hmm, instead of all the if statements, why not have arrays for these case, i.e. ^!SetArray %dayofweek%=Sunday;Monday;... ^!SetArray
          Message 4 of 9 , Aug 6 3:25 AM
            Hmm, instead of all the if statements, why not have arrays
            for these case, i.e.

            ^!SetArray %dayofweek%=Sunday;Monday;...
            ^!SetArray %monthname%=January;February;...


            When you need to extract the day of week, increment the index:
            ^!Inc %day%
            ^!Set %day%=^%dayofweek^%day%%

            For months, you will not have to increment:
            ^!Set %month%=^%monthname^%month%%



            Abair.



            --- In ntb-clips@yahoogroups.com, "John Zeman" <john041650@...> wrote:
            >
            > --- In ntb-clips@yahoogroups.com, Lee Underwood <leeu@> wrote:
            >
            >
            > ;begin clip to insert any date in long form
            >
            > ^!Set %indtg%=^?{(M="00/00/0000;1;*")Enter Date (mm/dd/yyyy)}
            > ^!Set %y%=^$StrCopy(^%indtg%;7;4)$
            > ^!Set %m%=^$StrCopy(^%indtg%;1;2)$
            > ^!Set %d%=^$StrCopy(^%indtg%;4;2)$
            >
            > ^!If ^%m%<3 z1
            > :z
            > ^!Set %z%=^%y%
            > ^!Goto calc
            > :z1
            > ^!Set %z%=^$CALC(^%y%-1)$
            > :calc
            > ^!Set %z4%=^$CALC(^%z%/4;3)$
            > ^!Set %iz4%=^$CALC(INT(^%z4%))$
            > ^!Set %z100%=^$CALC(^%z%/100;3)$
            > ^!Set %iz100%=^$CALC(INT(^%z100%))$
            > ^!Set %z400%=^$CALC(^%z%/400;3)$
            > ^!Set %iz400%=^$CALC(INT(^%z400%))$
            > ^!Set %m23%=^$CALC(^%m%*23)$
            > ^!Set %m9%=^$CALC(^%m23%/9;3)$
            > ^!Set %im9%=^$CALC(INT(^%m9%))$
            > ^!If ^%m%<3 DOW1
            > :DOW
            > ^!Set %dow%=^$CALC(^%im9%+^%d%+4+^%z%+^%iz4%-^%iz100%+^%iz400%-2)$
            > ^!Set %day%=^$CALC(^%dow%MOD7)$
            > ^!Goto Weekday
            > :DOW1
            > ^!Set %dow%=^$CALC(^%im9%+^%d%+4+^%z%+^%iz4%-^%iz100%+^%iz400%+1)$
            > ^!Set %day%=^$CALC(^%dow%MOD7)$
            > ^!if ^%m%=01 ^!Set %month%="January"
            > ^!if ^%m%=02 ^!Set %month%="February"
            > ^!if ^%m%=03 ^!Set %month%="March"
            > ^!if ^%m%=04 ^!Set %month%="April"
            > ^!if ^%m%=05 ^!Set %month%="May"
            > ^!if ^%m%=06 ^!Set %month%="June"
            > ^!if ^%m%=07 ^!Set %month%="July"
            > ^!if ^%m%=08 ^!Set %month%="August"
            > ^!if ^%m%=09 ^!Set %month%="September"
            > ^!if ^%m%=10 ^!Set %month%="October"
            > ^!if ^%m%=11 ^!Set %month%="November"
            > ^!if ^%m%=12 ^!Set %month%="December"
            > :Weekday
            > ^!if ^%m%=01 ^!Set %month%="January"
            > ^!if ^%m%=02 ^!Set %month%="February"
            > ^!if ^%m%=03 ^!Set %month%="March"
            > ^!if ^%m%=04 ^!Set %month%="April"
            > ^!if ^%m%=05 ^!Set %month%="May"
            > ^!if ^%m%=06 ^!Set %month%="June"
            > ^!if ^%m%=07 ^!Set %month%="July"
            > ^!if ^%m%=08 ^!Set %month%="August"
            > ^!if ^%m%=09 ^!Set %month%="September"
            > ^!if ^%m%=10 ^!Set %month%="October"
            > ^!if ^%m%=11 ^!Set %month%="November"
            > ^!if ^%m%=12 ^!Set %month%="December"
            > ^!if ^%day%=0 ^!Set %day%="Sunday"
            > ^!if ^%day%=1 ^!Set %day%="Monday"
            > ^!if ^%day%=2 ^!Set %day%="Tuesday"
            > ^!if ^%day%=3 ^!Set %day%="Wednesday"
            > ^!if ^%day%=4 ^!Set %day%="Thursday"
            > ^!if ^%day%=5 ^!Set %day%="Friday"
            > ^!if ^%day%=6 ^!Set %day%="Saturday"
            >
            >
            > ^!InsertText ^%day%, ^%month% ^%d%, ^%y%
            >
          • Lee Underwood
            John, Sorry for taking so long to get back ... just real busy. That s the answer I was looking for! Thanks. I also learned a bit from it. Lee On 8/4/2006 08:31
            Message 5 of 9 , Aug 21 1:01 PM
              John,

              Sorry for taking so long to get back ... just real busy.

              That's the answer I was looking for! Thanks. I also learned a bit from it.

              Lee


              On 8/4/2006 08:31 PM, John Zeman wrote:
              ........................................................

              >Here ya go mate. I can't take credit for this clip however, the
              >main engine that parses the date you enter was written by Steve
              >Veltkamp several years ago. To this day I use it all the time for
              >needs such as yours.
              >
              >You should be able to adapt it to the format you need.
              >
              >John
              >
              >;begin clip to insert any date in long form
              >
              >^!Set %indtg%=^?{(M="00/00/0000;1;*")Enter Date (mm/dd/yyyy)}
              >^!Set %y%=^$StrCopy(^%indtg%;7;4)$
              >^!Set %m%=^$StrCopy(^%indtg%;1;2)$
              >^!Set %d%=^$StrCopy(^%indtg%;4;2)$
              >
              >^!If ^%m%<3 z1
              >:z
              >^!Set %z%=^%y%
              >^!Goto calc
              >:z1
              >^!Set %z%=^$CALC(^%y%-1)$
              >:calc
              >^!Set %z4%=^$CALC(^%z%/4;3)$
              >^!Set %iz4%=^$CALC(INT(^%z4%))$
              >^!Set %z100%=^$CALC(^%z%/100;3)$
              >^!Set %iz100%=^$CALC(INT(^%z100%))$
              >^!Set %z400%=^$CALC(^%z%/400;3)$
              >^!Set %iz400%=^$CALC(INT(^%z400%))$
              >^!Set %m23%=^$CALC(^%m%*23)$
              >^!Set %m9%=^$CALC(^%m23%/9;3)$
              >^!Set %im9%=^$CALC(INT(^%m9%))$
              >^!If ^%m%<3 DOW1
              >:DOW
              >^!Set %dow%=^$CALC(^%im9%+^%d%+4+^%z%+^%iz4%-^%iz100%+^%iz400%-2)$
              >^!Set %day%=^$CALC(^%dow%MOD7)$
              >^!Goto Weekday
              >:DOW1
              >^!Set %dow%=^$CALC(^%im9%+^%d%+4+^%z%+^%iz4%-^%iz100%+^%iz400%+1)$
              >^!Set %day%=^$CALC(^%dow%MOD7)$
              >^!if ^%m%=01 ^!Set %month%="January"
              >^!if ^%m%=02 ^!Set %month%="February"
              >^!if ^%m%=03 ^!Set %month%="March"
              >^!if ^%m%=04 ^!Set %month%="April"
              >^!if ^%m%=05 ^!Set %month%="May"
              >^!if ^%m%=06 ^!Set %month%="June"
              >^!if ^%m%=07 ^!Set %month%="July"
              >^!if ^%m%=08 ^!Set %month%="August"
              >^!if ^%m%=09 ^!Set %month%="September"
              >^!if ^%m%=10 ^!Set %month%="October"
              >^!if ^%m%=11 ^!Set %month%="November"
              >^!if ^%m%=12 ^!Set %month%="December"
              >:Weekday
              >^!if ^%m%=01 ^!Set %month%="January"
              >^!if ^%m%=02 ^!Set %month%="February"
              >^!if ^%m%=03 ^!Set %month%="March"
              >^!if ^%m%=04 ^!Set %month%="April"
              >^!if ^%m%=05 ^!Set %month%="May"
              >^!if ^%m%=06 ^!Set %month%="June"
              >^!if ^%m%=07 ^!Set %month%="July"
              >^!if ^%m%=08 ^!Set %month%="August"
              >^!if ^%m%=09 ^!Set %month%="September"
              >^!if ^%m%=10 ^!Set %month%="October"
              >^!if ^%m%=11 ^!Set %month%="November"
              >^!if ^%m%=12 ^!Set %month%="December"
              >^!if ^%day%=0 ^!Set %day%="Sunday"
              >^!if ^%day%=1 ^!Set %day%="Monday"
              >^!if ^%day%=2 ^!Set %day%="Tuesday"
              >^!if ^%day%=3 ^!Set %day%="Wednesday"
              >^!if ^%day%=4 ^!Set %day%="Thursday"
              >^!if ^%day%=5 ^!Set %day%="Friday"
              >^!if ^%day%=6 ^!Set %day%="Saturday"
              >
              >
              >^!InsertText ^%day%, ^%month% ^%d%, ^%y%
              ........................................................
            Your message has been successfully submitted and would be delivered to recipients shortly.