i want to get lastmonth like 122023 as a result, h...
# suitescript
v
i want to get lastmonth like 122023 as a result, how to achieve this?
👎 1
a
I have no idea what you're asking for, but this is a solution to the problem as stated, which I'm sure is not the problem you're trying to solve.
Copy code
function getLastMonthString(){
    var then = new Date();
    then.setDate(0);
    return `${then.getMonth()+1}${then.getFullYear()}`;
}
🤭 2
s
I don’t think that works?
a
s
Ah, I get it, sorry.
a
umm apology accepted? 😄
f
moment.js