日期格式显示DOB [英] date format display DOB

查看:151
本文介绍了日期格式显示DOB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

海,
如何显示DOB这种格式:1985年1月1日
在文本框中.(dd-MMM-yyyy)

textbox1.text = 01-1985年1月

问候,
Karthikeyan,
班加罗尔.

Hai,
How to display DOB this format : 01-Jan-1985
in textbox.(dd-MMM-yyyy)

textbox1.text=01-Jan-1985

Regards,
Karthikeyan,
Bangalore.

推荐答案

尝试一下:
Try this:
textbox1.text=DateTime.Now.ToString("dd-MMM-yyyy");




or

textbox1.text=(Convert.ToDateTime("1-1-1985")).ToString("dd-MMM-yyyy");



输出将是:



Output will be:

24-Sep-2012



--Amit



--Amit


因此,如果您从数据库或其他任何地方获取出生日期值,他们会将其放在一个变量中.
So if you are getting the Birth date value from Database or from anywhere, them put that in one variable.
DataTime birthDate = new DataTime(1985, 1, 1); // or get from Database.
textbox1.text = birthDate.ToString("dd-MMM-yyyy");


这篇关于日期格式显示DOB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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