Hello, greetings to all!
I am having an issue where I am using the following ignition expression:
Expression structure:
{value}["Year"] = 2023
{value}["Month"] = 11
{value}["Day"] = 31
Expression transform:
dateFormat(getDate({value}["Year"],{value}["Month"],{value}["Day"]), "dd-MMM-YY")
The value that I am expecting to be returned is 31-Dec-23
but it is returning 31-Dec-24
, any ideas of why is it behaving like this ?
The getDate expression is working just fine, the issue comes from dateFormat, I tried using the format yyyy-MM-dd
and returns 2023-12-31
as expected .
Binding for copy and pasting
{
"type": "expr-struct",
"config": {
"struct": {
"Year": 2023,
"Month": 11,
"Day": 31
},
"waitOnAll": true
},
"transforms": [
{
"expression": "dateFormat(getDate({value}[\"Year\"],{value}[\"Month\"],{value}[\"Day\"]), \"dd-MMM-YY\")",
"type": "expression"
}
]
}
Thanks in advance!