从datagrid填充文本框时如何更改日期格式 [英] how to change format of date when filling the textbox from datagrid

查看:63
本文介绍了从datagrid填充文本框时如何更改日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据网格中显示的日期为dd/mm/yyyy格式.
我在单击datagrid时填充文本框.
我想在填写文本框时将日期格式改回mm/dd//yyyy.

我已经编写了用于在javascript中填充文本框并在datagrid的onclick上调用该函数的代码.

请帮助我.

解决方案

嗨...

  date_One  As  日期时间
date_One = DateTime.Now.日期

Text1.Text = date_One.ToString(<跨度类= 代码串">  <跨度类=" 代码串 > MM/DD/YYYY")


The date diplaying in my datagrid is in the dd/mm/yyyy format.
I am filling the textboxes on the click of datagrid.
I want to change the format of date back to mm/dd//yyyy while filling the textbox.

I have written the code for filling the textbox in javascript and calling that function onclick of datagrid.

Please help me.

解决方案

Hi...

Dim date_One As New DateTime
date_One = DateTime.Now.Date

Text1.Text = date_One.ToString("MM/dd/yyyy")


这篇关于从datagrid填充文本框时如何更改日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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