web上的日期控件日期如何格式化?
在ASP程序中,我用到了网上一些大虾介绍的日期控件DTPicker,但得到的日期总是非正常格式的.不知道为什么:
<object classid="clsid:20DD1B9E-87C4-11D1-8BE3-0000F8754DA1" id="DTPicker1" width="162" height="16" >
<PARAM NAME="_ExtentX" VALUE="2646">
<PARAM NAME="_ExtentY" VALUE="688">
<PARAM NAME="_Version" VALUE="393216">
<PARAM NAME="MousePointer" VALUE="0">
<PARAM NAME="Enabled" VALUE="1">
<PARAM NAME="OLEDropMode" VALUE="0">
<PARAM NAME="CalendarBackColor" VALUE="-2147483643">
<PARAM NAME="CalendarForeColor" VALUE="-2147483630">
<PARAM NAME="CalendarTitleBackColor" VALUE="-2147483633">
<PARAM NAME="CalendarTitleForeColor" VALUE="-2147483630">
<PARAM NAME="CalendarTrailingForeColor" VALUE="-2147483631">
<PARAM NAME="CheckBox" VALUE="0">
<PARAM NAME="CustomFormat" VALUE="">
<PARAM NAME="DateIsNull" VALUE="0">
<PARAM NAME="Format" VALUE="662831105">
<PARAM NAME="UpDown" VALUE="0">
<PARAM NAME="CurrentDate" VALUE="36653">
<PARAM NAME="MaxDate" VALUE="2958465">
<PARAM NAME="MinDate" VALUE="-109205">
</object>
控件就是上面这个,在一个JS代码中,我获得了该控件的日期值:
<%
function getdate()
{
alert (document.form1.DTPicker1.value);
return true;
}
%>
但得到的值是:
Sun May 7 00:00:00 UTC+0800 2000
不知道怎么样才能转换成YYYY-MM-DD格式的