You can do a lot of such things using tstamp with format.
You cant do string manipulation though. This is only for date and time

-HK


On Wed, 13 Nov 2002 EXT / FOCAL MALAPRADE Roland wrote :
Yes that's what I'm looking for. something like this:

<datetime src="0206" format="yyMM" property="newdate" />

then ${newdate} = 2002-06-01

I supposed it would be better like this:

property date = 0206
<datetime src="${date}01" format="yyMMdd" property="newdate" />

then ${newdate} = 2002-06-01

There doesn't seems to be anything like this in Ant already, I'll probably
have to code it myself

Roland.



> -----Message d'origine-----
> De : Matt Benson [mailto:gudnabrsam@;yahoo.com]
> Envoye : mercredi 13 novembre 2002 16:02
> A : Ant Users List
> Objet : Re: converting date/time
>
>
> Are you saying that, based on the directory name being
> DirName_0206, you would know the corresponding date
> would be 2002-06-01? If so, then it seems like some
> simple String operations would do the trick... this
> led me to think how cool it would be if the properties
> syntax were expanded to include string and pattern
> operations a la bash (I don't know if all its string
> operators are available in ksh or csh). Probably it
> wouldn't be difficult to code (if somebody tells me
> where properties are parsed out of ${} syntax I might
> look into it myself) and it could maybe make life
> easier in cases like this.
>
> Another related thing that might be cool is to have
> either or both of: a way to limit the scope of a
> property, or a way to return a value from an
> <antcall>, so that it might not be so "costly" to use
> properties for temporary values.
>
> Okay, so now everybody tell me I'm crazy and argue
> with me... :)
>
> -Matt
>
>
> --- EXT / FOCAL MALAPRADE Roland
> <[EMAIL PROTECTED]> wrote:
> > I have a series of month-based directories in the
> > format "DirName_yyMM". So
> > for example: DirName_0206 is the directory for June
> > 2002.
> >
> > In these directory, I need to replace dates in some
> > files, but I need the
> > date in the format yyyy-MM-dd, for example,
> > "2002-06-01".
> >
> > Is there any task that can do this? like a <tstamp>
> > where you could specify
> > the date/time instead of the current date/time.
> >
> > I suppose I could just write a task myself, but if
> > something like that
> > already exists, it would make my life easier... or
> > lazier ;-)
> >
> > Thanks,
> > Roland.
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:ant-user-unsubscribe@;jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:ant-user-help@;jakarta.apache.org>
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> U2 on LAUNCH - Exclusive greatest hits videos
> http://launch.yahoo.com/u2
>
> --
> To unsubscribe, e-mail:
<mailto:ant-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@;jakarta.apache.org>

--
To unsubscribe, e-mail: <mailto:ant-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@;jakarta.apache.org>

__________________________________________________________
Give your Company an email address like
ravi @ ravi-exports.com.  Sign up for Rediffmail Pro today!
Know more. http://www.rediffmailpro.com/signup/


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@;jakarta.apache.org>

Reply via email to