Hi.
I have a problem with the format of the date. I am virtualizing a service and, in one of the labels, I must return a value to the current date.
How can I return the value with sysdate?
Hi.
I have a problem with the format of the date. I am virtualizing a service and, in one of the labels, I must return a value to the current date.
How can I return the value with sysdate?
You have a date format with no timezone information. I don't think the specific format you've got, which is yyyy-MM-dd'T'HH:mm:ss is listed in lisa.properties
My suggestion is to search this community for posts about "date format" and you'll see lots of information about adding your format to the list of formats that will be automatically replaced in DevTest with "doDateDeltaFrom..." lines, which will do what you want.
Rick’s suggestion will give you a permanent solution so that DevTest will recognize these strings during a recording and replace them automatically with a doDateDelta expression.
If you just want to quickly fix this response then replace the string with below:
{{=doDateDeltaFromCurrent("yyyy-MM-dd'T'HH:mm:ss");/2018-10-30T00:00:00/}}
Cheers,
Danny
The magic string expression again got "corrupted" after I sent it. As you can see from other magic strings in your response, the last part is the default value which is used if a property doesn't exist, it has to start with /* and end with */.
So, the correct expression is {{=doDateDeltaFromCurrent("yyyy-MM-dd'T'HH:mm:ss", "0D");/*2018-10-30T00:00:00*/}}
(fingers crossed that it should work this time :-) )
I am starting to understand what happens, when my mail contains /*<someText>*/ it is converted by this site into /<someTextInBold>/ , so that's an attention point for any email posts in the future.
Cheers,
Danny
Hi Danny.
I found the answer in the following URL:
https://comm.support.ca.com/kb/issues-with-dodatedeltafromcurrent/kb000102892
You helped me a lot with the first expression
Thank you
Yes, this function calculates the current date/timestamp and that value replaces the {{…}}
There is just something wrong with the syntax, I see a space between the equal sign (=) and the doDateDelta… Try it with that removed.
Cheers,
Danny