Link to home
Start Free TrialLog in
Avatar of brihol44
brihol44

asked on

How do I use yyyy-mm-dd format in javascript?

I'm a beginner at javascript. I need to figure out how to convert my date to be yyyy-mm-dd format and not the "dateformat" "yyyy/mm/dd" i'm getting now. "+DayOfMonth+" which = mm/dd/yyyy

Thanks,

B
<script language="JavaScript">
<!--
 
// function to populate the date on the form and to close this window. --->
function ShowDate(DayOfMonth) {
    var FormName="<cfoutput>#URL.FormName#</cfoutput>";
    var FieldName="<cfoutput>#URL.FieldName#</cfoutput>";
    eval("self.opener.document." + FormName + "." + FieldName + ".value='"+DayOfMonth+"'");
    window.close();
}
 
//-->
</script>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial