日期:2014-05-17 浏览次数:20744 次
string str="2013-11-6";
if(str.Split('-')[2].Length!=2)
{
str=str.Split('-')[0]+"-"+str.Split('-')[1]+"-0"+str.Split('-')[2];
}
<input size="16" type="text" value="" readonly class="form_datetime">
<script type="text/javascript">
$(".form_datetime").datetimepicker({format: 'yyyy-mm-dd hh:ii'});
</script>
dateTimePicker1.Format = DateTimePickerFormat.Custom;
dateTimePicker1.CustomFormat = "yyyy-MM-dd";