am i doing something wrong here
<cfscript>
x = '9/6/2024'; // its dd/mm/yyyy
dump(dateformat(x,'yyyy-mm-dd'));
</cfscript>
month is getting wrong, its should be 6, its going in as 9
t
Tim
05/08/2024, 5:28 PM
dateformat takes a date, not a string. So CF auto converts your string to a date, but does it using US rules which are mm/dd/yyyy.
So you need an explicit call to parse your sting to a date: