VB.net:没有时间的日期 [英] VB.net: Date without time

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

问题描述

你如何格式化日期到日期?

例如,这是我从数据库中检索到的:12/31/2008 12:00:00 AM,但我只想显示日期而没有时间。

解决方案

使用,它只指定日期(例如D或d),或者是一个自定义日期和时间格式字符串,它只使用日期部分(例如yyyy / MM / dd)。 p>

How do you format the date time to just date?

For example, this is what I retrieved from the database: 12/31/2008 12:00:00 AM, but I just want to show the date and no time.

解决方案

Either use one of the standard date and time format strings which only specifies the date (e.g. "D" or "d"), or a custom date and time format string which only uses the date parts (e.g. "yyyy/MM/dd").

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

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