how can i make sure that the format date will out ...
# suitescript
s
how can i make sure that the format date will out put mm/dd/yyyy meaning 09/01/2024 vs 9/1/2024
Copy code
let formatDate = format.format({
      value: portDateObject,
      type: format.Type.DATE,
    });
    return formatDate;
  }
e
format.format
will always use the preference of the current user or the system, so that function alone will never be a reliable way to get a consistent format. I generally use
moment.js
for date formatting/manipulation
s
i haven't used external library is it hard to import ?
e
Nope

https://www.youtube.com/watch?v=BlUqPUI9ALo

🙌 1