This is an automated email from the ASF dual-hosted git repository.
fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git
The following commit(s) were added to refs/heads/master by this push:
new ec3122abf1 Issue 5694: Document changed formatter for function __time()
ec3122abf1 is described below
commit ec3122abf1bc6ed6c7b766bcf55e8d0e7bb48b71
Author: Felix Schumacher <[email protected]>
AuthorDate: Mon Feb 20 14:39:36 2023 +0100
Issue 5694: Document changed formatter for function __time()
Closes #5694
---
xdocs/changes.xml | 1 +
xdocs/usermanual/functions.xml | 10 ++++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index 57f7e6df46..dcc7b18e6b 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -160,6 +160,7 @@ Summary
<h3>Documentation</h3>
<ul>
+ <li><issue>5694</issue>Document changed formatter for <funclink
name="__time()"/></li>
</ul>
<h3>General</h3>
diff --git a/xdocs/usermanual/functions.xml b/xdocs/usermanual/functions.xml
index 23fbe8a3c0..5e4078ea48 100644
--- a/xdocs/usermanual/functions.xml
+++ b/xdocs/usermanual/functions.xml
@@ -1121,7 +1121,7 @@ If omitted, <code>,</code> is used. Note that
<code>,</code> would need to be sp
<properties>
<property name="Format" required="No">
- The format to be passed to <a
href="https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html">SimpleDateFormat</a>.
+ The format to be passed to <a
href="https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html">DateTimeFormatter</a>.
The function supports various shorthand aliases, see below.
If omitted, the function returns the current time in milliseconds
since the epoch.
</property>
@@ -1131,7 +1131,7 @@ If omitted, <code>,</code> is used. Note that
<code>,</code> would need to be sp
If the format matches "<code>/ddd</code>" (where <code>ddd</code> are decimal
digits),
then the function returns the current time in milliseconds divided by the
value of <code>ddd</code>.
For example, "<code>/1000</code>" returns the current time in seconds since
the epoch.
-Otherwise, the current time is passed to SimpleDateFormat.
+Otherwise, the current time is passed to DateTimeFormatter.
The following shorthand aliases are provided:
</p>
<ul>
@@ -1147,6 +1147,12 @@ The following shorthand aliases are provided:
<p><source>${__time(dd/MM/yyyy,)}</source> will return
<code>21/01/2018</code> if ran on 21 january 2018</p>
<p><source>${__time(YMD,)}</source> will return <code>20180121</code> if ran
on 21 january 2018</p>
<p><source>${__time()}</source> will return time in millis
<code>1516540541624</code></p>
+<note>
+ The format to be passed to used to be <a
href="https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html">SimpleDateFormat</a>,
+ but that changed with JMeter 5.5 to <a
href="https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html">DateTimeFormatter</a>.
+ While they use mostly the same codes, they differ slightly. Most notable is
probably the code <code>u</code>, that meant
+ <em>day number of week</em> and is now interpreted as <em>year</em>.
+</note>
</component>
<component index="§-num;.5.18" name="__jexl2">