本文介绍了如何转换datetimepickers格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须将datetimepickers格式更改为DD/MM/YY.
在按钮上单击.
怎么可能.
我该怎么办???
带有ASP.NET的Web应用程序

I have to change datetimepickers format to DD/MM/YY.
on button click.
how it is possible.
what should i have to do????
Web Application with ASP.NET

推荐答案

SELECT CONVERT(VARCHAR(8), GETDATE(), 1) AS [MM/DD/YY]


public void SetMyCustomFormat()
{
   // Set the Format type and the CustomFormat string.
   dateTimePicker1.Format = DateTimePickerFormat.Custom;
   dateTimePicker1.CustomFormat = "MMMM dd, yyyy - dddd";
}



来源: http://msdn. microsoft.com/en-us/library/system.windows.forms.datetimepicker.format%28v=vs.90%29.aspx [ ^ ]



Source : http://msdn.microsoft.com/en-us/library/system.windows.forms.datetimepicker.format%28v=vs.90%29.aspx[^]


DateTime date = (DateTime.Now);


string str = string.Format("dd-MM-yyyy");
string ab = date.ToString(str);


最好的问候..
K


Best Regards..
K


这篇关于如何转换datetimepickers格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 08:37