格式化日期时间欧元风格 [英] Formatting Date Time Euro style

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

问题描述




可能是一个愚蠢的问题,但我在为一些

原因做这件事时遇到了问题。我有一个短期日期时间美式风格(mm / dd / yy)。我需要

将它转换为欧洲格式的字符串(年/月/日)。


我希望有人可以帮助我。 。


TIA


史蒂夫

Hi

Probably a dumb question, but I''m having problems doing this for some
reason. I have a shortdate as datetime American Style (mm/dd/yy). I need to
convert it to a string that is in European format (dd/mm/yy).

I was hoping someone could help me out..

TIA

Steve

推荐答案

嗨史蒂夫


您可以使用格式化功能更改日期的显示方式。


Dim MyDate As Date = Now


Dim MyString As String


MyString =格式(MyDate," dd / MM / yyyy")

MsgBox (MyString)


确保你使用本月的大写M'(M)而不是小写m'(m)

当你很可能会发现它返回分钟而不是几个月。


希望这会有所帮助。


Neil Knobbe


Visual Basic MVP

" Steve Peterson" < SP ******* @ arrakis.es>在消息中写道

新闻:ud ************** @ TK2MSFTNGP12.phx.gbl ...
Hi Steve

You can change how the Date is Displayed by using the Format Function.

Dim MyDate As Date = Now

Dim MyString As String

MyString = Format(MyDate, "dd/MM/yyyy")

MsgBox(MyString)

Make sure that you use capital M''s (M) for the Month not lowercase m''s (m)
as you may well find it returning Minutes rather than Months.

Hope this helps.

Neil Knobbe

Visual Basic MVP

"Steve Peterson" <sp*******@arrakis.es> wrote in message
news:ud**************@TK2MSFTNGP12.phx.gbl...


可能是一个愚蠢的问题,但是出于某种原因,我遇到了问题。我有一个短期日期时间美式风格(mm / dd / yy)。我需要
将其转换为欧洲格式的字符串(年/月/日)。

我希望有人可以帮助我..
TIA

史蒂夫
Hi

Probably a dumb question, but I''m having problems doing this for some
reason. I have a shortdate as datetime American Style (mm/dd/yy). I need to convert it to a string that is in European format (dd/mm/yy).

I was hoping someone could help me out..

TIA

Steve



*" Steve Peterson" < SP ******* @ arrakis.es> scripsit:
* "Steve Peterson" <sp*******@arrakis.es> scripsit:
可能是一个愚蠢的问题,但由于某些原因,我遇到了问题。我有一个短期日期时间美式风格(mm / dd / yy)。我需要将它转换为欧洲格式的字符串(年/月/日)。
Probably a dumb question, but I''m having problems doing this for some
reason. I have a shortdate as datetime American Style (mm/dd/yy). I need to
convert it to a string that is in European format (dd/mm/yy).




我不知道有没有欧洲日期格式。在奥地利,我们使用

" dd.mm.yyyy。


-

Herfried K. Wagner [MVP ]

< URL:http://dotnet.mvps.org/>



I didn''t know that there is a European date format. In Austria, we use
"dd.mm.yyyy".

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


OOPS! - 我倒退了......抱歉..

" Herfried K. Wagner [MVP]" <喜*************** @ gmx.at>在消息中写道

news:c7 ************ @ ID-208219.news.uni-berlin.de ...
OOPS! - I got it backwards.. Sorry..
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c7************@ID-208219.news.uni-berlin.de...
* 史蒂夫彼得森 < SP ******* @ arrakis.es> scripsit:
* "Steve Peterson" <sp*******@arrakis.es> scripsit:
可能是一个愚蠢的问题,但由于某些原因,我遇到了问题。我有一个短期日期时间美式风格(mm / dd / yy)。 I
需要将其转换为欧洲格式的字符串(年/月/日)。
Probably a dumb question, but I''m having problems doing this for some
reason. I have a shortdate as datetime American Style (mm/dd/yy). I need to convert it to a string that is in European format (dd/mm/yy).



我不知道有欧洲日期格式。在奥地利,我们使用
dd.mm.yyyy。

-
Herfried K. Wagner [MVP]
< URL:http:/ /dotnet.mvps.org/>



I didn''t know that there is a European date format. In Austria, we use
"dd.mm.yyyy".

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>



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

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