Date
Date
values are formatted using a SimpleDateFormat
object. The format can be one of two options depending on the loadmaster.ws.useServerTimezone
vmparam. When the vmparam
is set to true
, the format is yyyyMMddHHmmss
and when it is false
, the format is yyyyMMddHHmmssZ
.
Currently, this vmparam is set to false
.
Parsing of incoming Date
values is also governed by the date format as described above with one exception. The service also accepts
the standard LoadMaster™/PowerBroker™ date shortcuts.
n
- now (today at current time)
t
- today
m
- first day of current month
w
- first day of current week
q
- first day of current quarter
y
- first day of current year
me
- last day of current month
we
- last day of current week
qe
- last day of current quarter
ye
- last day of current year
In addition to the date shortcuts, simple addition and subtraction on these values is supported. For example, use t1
for tomorrow and
t-7
for one week ago.
All of the shortcuts use midnight (0 hours, 0 minutes, 0 seconds) for the time component except for n
which uses the current date and
time. To specify the time component, include the hours and minutes as two digits each in military time. For example, to specify one week from now at
1:30PM, use t7 1330
.
Omitted values are interpreted as null
.
Example
For example, if you had a widget
with an id
integer field and a create_date
Date field, it might look like:
XML
This widget has a create_date
of August 16, 2016 5:01PM CDT.
<widget id="1" create_date="20160816170100-0500"/>
This widget has a create_date
of today at 9:45AM.
<widget id="1" create_date="t 0945"/>
JSON
This widget has a create_date
of August 16, 2016 5:01PM CDT.
{"__type":"widget", "id":"1", "create_date":"20160816170100-0500"}
This widget has a create_date
of today at 9:45AM.
{"__type":"widget", "id":"1", "create_date":"t 0945"}
See also