设置日期时间格式 [英] to set format of datetime

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

问题描述

我有组合框,它从sql获取数据,并且用于获取datetime.但是它具有mm-dd-yyyy bt格式,我想像dd-MMM-yyyy一样更改它,所以我如何更改它

i have combobox it get data from sql and it is use for get datetime.but it hase format mm-dd-yyyy bt i want to change it like dd-MMM-yyyy so how can i change it

推荐答案

如果输入.在对象之后,intellisense将列出该对象的所有方法.编码为101.您将在其中找到返回所需格式的方法.如果您不这样做,则google可以神奇地搜索整个Internet,但是msdn.microsoft.com是Microsoft文档,它将解释ToString重载,可以帮助您格式化日期.
If you type a . after your object, intellisense will list all the methods of that object. That''s coding 101. You will find methods in there to return the format you want. If you don''t, then google can magically search the entire internet, but msdn.microsoft.com is the Microsoft documentation, and it will explain the ToString overloads that will help you to format the date.


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

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