Conversion storeEval To executeScript_Sandbox code for current year

@thecoder2012 @Timo @Plankton @ulrich

I need to convert from storeEval to executeScript_Sandbox this code that return the current year in forma NNNN example 2019

With storeeval works, i need the same function in executeScript_Sandbox.

{
  "Command": "storeEval",
  "Target": "new Date().getFullYear();",
  "Value": "Current_Year"
}

Thanks for help

Then try it. Change your “Command” in executeScript_Sandbox and add “return” in your “Target”.

Example:

{
  "Name": "test-year",
  "CreationDate": "2019-10-9",
  "Commands": [
    {
      "Command": "executeScript_Sandbox",
      "Target": "return new Date().getFullYear();",
      "Value": "Current_Year"
    },
    {
      "Command": "echo",
      "Target": "${Current_Year}",
      "Value": ""
    }
  ]
}
1 Like

The code you wrote works perfectly, thanks you were very kind