Forum Discussion

AConner's avatar
New Contributor
7 years ago

How to send last months date in JSON reqest while doing a HTTP Post.

I saw how to add today's date dynamically into the json payload, now I want to take tat one step further and dynamically add todays date minus 30 days into the payload.  here is the example that I ha...
  • Lucian's avatar
    7 years ago



    That's quite simple:


      "page": 0,
      "recordsPerPage": 10,
      "find": {
        "initiationDateFrom": "${= StatementDate = Calendar.getInstance(); StatementDate.add(Calendar.DAY_OF_MONTH, -30); StatementDate.format('MM/dd/yyyy')}",
        "initiationDateTo": "${= StatementDate = Calendar.instance; StatementDate.format('MM/dd/yyyy')}"
      "sort": {
        "initiationDate": -1

    You can refer to,%20int) for more information. :smileyhappy:


    Let me know if it works!