如何从日期格式中删除时间 [英] How to remove time from date format

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

问题描述

我将日期作为数据类型(日期)。



当我在网页上显示时,它带有日期时间格式。



但我想删除约会时间。



所以请帮我PLZ。





Label1.Text = ds.Tables(table_name)。行(0).Item(dob)。ToString



Label2.Text = ds.Tables(table_name)。行(0).Item(doj)。ToString



Label3 .Text = ds.Tables(table_name)。Rows(0).Item(dor)。ToString







提前感谢...

I get the date as datatype(date).

When i show that into the webpage, it comes with datetime format.

But i want to remove the time from the date.

so help me plz.


Label1.Text = ds.Tables("table_name").Rows(0).Item("dob").ToString

Label2.Text = ds.Tables("table_name").Rows(0).Item("doj").ToString

Label3.Text = ds.Tables("table_name").Rows(0).Item("dor").ToString



thanks in advance...

推荐答案

尝试
YourDateField.ToShortDateString()


试试这个



Try this

Label1.Text = ds.Tables("table_name").Rows(0).Item("dob").ToString("dd/MM/yyyy");


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

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