在Visual Basic中更改日期格式 [英] changing date format in Visual Basic

查看:115
本文介绍了在Visual Basic中更改日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2010编写一个小型VB.NET程序。我必须从MS Access数据库中获取日期,数据库中的日期是(mm-dd-yyyy)格式我要转换它是(dd-mm-yyyy)格式。请帮助我。

解决方案

这是可以帮助你的代码。

 var dateAsString = MSAccessDateTime .ToString(  dd / MM / yyyy); 
// dateAsString = 2015年10月12日


I am writing a small VB.NET Program using Visual Studio 2010. In that I have to fetch a date from a MS Access Database , the date in the DB is in (mm-dd-yyyy) format I want to convert it to (dd-mm-yyyy) format. Please help me.

解决方案

Here is the code that can help you.

 var dateAsString = MSAccessDateTime.ToString("dd/MM/yyyy");
// dateAsString = "10/12/2015"


这篇关于在Visual Basic中更改日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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