如何更改DateTime对象在DataGridView中显示的方式 [英] how do I change the way a DateTime object is displayed in a DataGridView

查看:42
本文介绍了如何更改DateTime对象在DataGridView中显示的方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改DateTime对象在DataGridView中的显示方式.具体来说,我想显示带时间的秒数.

I would like to change the way a DateTime object is displayed in a DataGridView. Specifically, I would like to have seconds displayed with the time.

c#.net 2.0

c# .net 2.0

推荐答案

dataGridView1.Columns[0].DefaultCellStyle.Format = "MM/dd/yyyy HH:mm:ss";

有关特定格式,请查看以下链接:

For specific formatting, check out these links:

这篇关于如何更改DateTime对象在DataGridView中显示的方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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