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

12443Re: [Clip] Easier Date Question

Expand Messages
  • Alan
    Sep 3, 2004

      I gather that it is not the current date and/or time that you are or
      that you need to work with but instead, you obtain a date from a doc and
      then that what you are asking how to do is to reformat and output that
      date ?

      I mentioned that because Ntab has a function that returns the current
      date and/or time. it is: $^getdate(your-filter-goes-here)$

      help > help on clip programming > click the index tab > scroll down to:

      so as to reference on that.
      But if I'm correct on what you want, then what you want **has nothing to
      do with the above mentioned getdate function.** Instead, you need to
      recognize date digits and/[or months (alpha, not numeric)] then convert
      and output into your desired formats.

      > Given a string which can be set as a variable (%DocDate%) can we get
      > Notetab to recognize that it is a date?

      likely could nearly or perhaps nearly enough approximate such
      recognition using a regular expression to do so. Something that would
      work using regexp
      > For instance, in my doc, the date appears in any one of the
      > following formats:
      > March 01, 2004
      > MAR 1 2004
      > 03/01/2004
      > 03/01/04
      > I can select the string, set the variable, but then I need to output
      > the date in 2 places in 2 different formats:

      Alright. Likely not too difficult using a regexp when it's all digits.
      But when it's alpha as well as numeric then it appears to me that you
      would need to create and use a "look up table" so to speak. For
      example, looks up (looks in either another clip, a data clip, or a data
      file) "MAR" and returns its numeric equivalent of 03

      you might have to scan with two regex, one for the numeric, the other to
      find the alpha. But a regex guru might able, yes I just realized it can
      incorporate all into one regex using the |

      (in regex geek) for example: MAR|03

      finds for MAR and/or also finds for 03

      help > help topics > click index tab > scroll down to RegExp

      I think Ntab can do what you want. Did I hear Perl? Yes, Perl could do
      it as well.

    • Show all 9 messages in this topic