c#windows apllication中的日期时间选择器 [英] date time picker in c# windows apllication

查看:57
本文介绍了c#windows apllication中的日期时间选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




i采取日期时间选择器



DateTime dt = dateTimePicker1.Value;

textBox15.Text = dt.ToString(dd-MMM-YY);



但它只显示25-04-YY

没有显示年份



我想要显示年份

Hi
i take date time picker

DateTime dt = dateTimePicker1.Value;
textBox15.Text = dt.ToString("dd-MMM-YY");

but its showing only 25-04-YY
not showing year

what i want to do for showing year

推荐答案

DateTime dt = dateTimePicker1。价值;

textBox15.Text = dt.ToString(dd-MMM-yy);

将YY改为yy
DateTime dt = dateTimePicker1.Value;
textBox15.Text = dt.ToString("dd-MMM-yy");
make "YY" to "yy"


这篇关于c#windows apllication中的日期时间选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆