Hi
in beanshell
import java.util.Date;
import java.text.SimpleDateFormat;
long millis = System.currentTimeMillis() + 1500; // value you want to add
Date d = new Date(millis);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
String formattedDate = sdf.format(d);
You could put the returned value in a variable or reuse the beanshell
function or whatever
vars.put("formattedDate", formattedDate);
regards
deepak
On Mon, Feb 22, 2010 at 8:55 AM, noc2007 <[email protected]> wrote:
>
> thanks for your answer;
> do you think i can find an example of that?
>
> thanks in advance
>
>
> sebb-2-2 wrote:
> >
> > On 22/02/2010, noc2007 <[email protected]> wrote:
> >>
> >> In JMeter it is possible to use the current time in you script, and
> >> format is
> >> in the way we like, for example:
> >> ${__time(HH:mm:ss)}.
> >>
> >> I would like to know if it possible to add a number of (milli)seconds
> or
> >> minutes to the current time and use the same format.
> >
> > Currently not possible using the __time() function.
> >
> > However, you can use the __BeanShell(), __javaScript() or __jexl()
> > functions to invoke the appropriate Java methods.
> >
> >> thanks in advance
> >>
> >> --
> >> View this message in context:
> >> http://old.nabble.com/add-time-to-current-time-tp27686680p27686680.html
> >> Sent from the JMeter - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [email protected]
> >> For additional commands, e-mail: [email protected]
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/add-time-to-current-time-tp27686680p27690426.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>