如何将 Datagridview 中的格式列更改为此值的日期类型 [英] How to Change Format column in Datagridview to date type for this value

查看:26
本文介绍了如何将 Datagridview 中的格式列更改为此值的日期类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我有一个这样的值:

For example, I have a value like this :

41607.2069444444; 41607.2068402778; 41607.2072222222;

这是从 CDR 计算 dateTimeOrigination,在 excel 中,我将格式单元格更改为键入日期,它的工作,这是 11/29/2013 4:58:42 AM.我的问题是如何在 VB.net 的 datagridview 中将此值格式化为日期?

this is calculation of dateTimeOrigination from CDR, in excel where i change the format cell to type date, its work and this is 11/29/2013 4:58:42 AM. My questions is how to format this value to date in datagridview in VB.net?

推荐答案

试试这个:

MyDatagridview.Columns(4).DefaultCellStyle.Format = "dd.MM.yyyy HH:mm:ss"

在我的情况下,第 5 列(请记住 Datagridview.Columns 是从零开始的)是 Date-Type让我知道它是否对您有帮助:)

In my case the 5th column (Remember that Datagridview.Columns are zero-based) is Date-Type Let me know if it helped you :)

这篇关于如何将 Datagridview 中的格式列更改为此值的日期类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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