Return-Path: Delivered-To: apmail-jakarta-jmeter-user-archive@www.apache.org Received: (qmail 59077 invoked from network); 22 Feb 2010 19:24:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Feb 2010 19:24:15 -0000 Received: (qmail 76377 invoked by uid 500); 22 Feb 2010 19:24:15 -0000 Delivered-To: apmail-jakarta-jmeter-user-archive@jakarta.apache.org Received: (qmail 76325 invoked by uid 500); 22 Feb 2010 19:24:15 -0000 Mailing-List: contact jmeter-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "JMeter Users List" Reply-To: "JMeter Users List" Delivered-To: mailing list jmeter-user@jakarta.apache.org Received: (qmail 76315 invoked by uid 99); 22 Feb 2010 19:24:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Feb 2010 19:24:15 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of shettyd@gmail.com designates 209.85.160.44 as permitted sender) Received: from [209.85.160.44] (HELO mail-pw0-f44.google.com) (209.85.160.44) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Feb 2010 19:24:06 +0000 Received: by pwi3 with SMTP id 3so3053789pwi.31 for ; Mon, 22 Feb 2010 11:23:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=gkMe4Ss3B61uTCRH9gMHug5wSCgd67JLnDFmsmumQI0=; b=J5O0UYRRc1sY8bwNSnK49y+daabBZF1MngRzQm0OdEJPBMdZFHzPMH9ByyII7er3fx QIoy4MEEBAQGqquU60R/ilABF3LEvLYghgl3Ub3yWK3ZaIRb6LOZ6Tqv7Gt6HAlPknVS 8tObfEKlMkaBAjgfZ0Mzq8Mq5z8MUm4PpJKSc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=leJ+injfWMaOiox0L082kICrjv8MRleGKM4yNLJLAdiNWbGXHKzCVK+RFXDiTerYhG fj5+O9GEcqhgE9eWtOYQ1TQPmlKj7wHlrBvVL8kl2mvFkpd4eFgFntKbPdynYySadeYD Q0WfMHq8DhIwuQokUGZ+qgjz/M3Cx7JVN60aQ= MIME-Version: 1.0 Received: by 10.140.82.25 with SMTP id f25mr6001475rvb.106.1266866624646; Mon, 22 Feb 2010 11:23:44 -0800 (PST) In-Reply-To: <27690426.post@talk.nabble.com> References: <27686680.post@talk.nabble.com> <25aac9fc1002220849l7e2e7ecak5cf76fce649927c3@mail.gmail.com> <27690426.post@talk.nabble.com> Date: Mon, 22 Feb 2010 11:23:44 -0800 Message-ID: <4483c26c1002221123n348eac7i6df4c58eb0dc6502@mail.gmail.com> Subject: Re: add time to current time From: Deepak Shetty To: JMeter Users List Content-Type: multipart/alternative; boundary=000e0cd2e04e23cdbe0480355fdf X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd2e04e23cdbe0480355fdf Content-Type: text/plain; charset=ISO-8859-1 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 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 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: jmeter-user-unsubscribe@jakarta.apache.org > >> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org > >> > >> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org > > > > > > > > -- > 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: jmeter-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org > > --000e0cd2e04e23cdbe0480355fdf--