12443Re: [Clip] Easier Date Question
- Sep 3, 2004Hi,
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
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 getlikely could nearly or perhaps nearly enough approximate such
> Notetab to recognize that it is a date?
recognition using a regular expression to do so. Something that would
work using regexp
>Alright. Likely not too difficult using a regexp when it's all digits.
> For instance, in my doc, the date appears in any one of the
> following formats:
> March 01, 2004
> MAR 1 2004
> I can select the string, set the variable, but then I need to output
> the date in 2 places in 2 different formats:
> YYYY-MM-DD AND MM/DD/YYYY.
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.
- << Previous post in topic Next post in topic >>