在vb.net中更改日期格式 [英] changing the date format in vb.net

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

问题描述

当我使用日期格式从一台带有Windows的PC复制一个vb.net项目时

日期格式f.e. dd / mm / yyyy到格式为yy / mm / dd的另一台PC然后我

得到错误。

如何在项目中更改一段时间的日期格式在vb.code(

不在Windows中)我如何找出PC Windows使用的日期格式

使用。

谢谢你任何回复

When I copy a vb.net project using date formats from one PC with a windows
date format f.e. dd/mm/yyyy to another PC having a format yy/mm/dd then I
get errors.
How can I change for a while in the project the date format in vb.code (
not in Windows) and how can I find out which date format the PC Windows is
using.
Thanks for any response

推荐答案

而不是使用或更改日期,为什么不自己制作?


Dim str as String = Now.Day& " /" &安培; Now.Month& " /" &安培; Now.Year


给出:


dd / mm / yy


-

-iwdu15
instead of using or changing the date, why not make your own?

Dim str as String = Now.Day & "/" & Now.Month & "/" & Now.Year

which gives:

dd/mm/yy

--
-iwdu15


不能工作

当我在我的vb中输入dd / mm / yy /.net程序(在另一台PC上)正在思考

是yy / mm / dd所以有一个错误

有一些代码用于它全球化,但我不知道

代码

无论如何谢谢


" iwdu15" < jmmgoalsteratyahoodotcom>在消息中写道

news:17 ********************************** @ microsof t.com ...
That don''t work
When i put in dd/mm/yy in my vb/.net program (on the other PC) is thinking
that is is yy/mm/dd so there is a error
There is some code for it with the word globalisation but I don''t know the
code
Thanks any way

"iwdu15" <jmmgoalsteratyahoodotcom> wrote in message
news:17**********************************@microsof t.com...
而不是使用或更改日期,为什么不自己制作?

Dim str as String = Now.Day& " /" &安培; Now.Month& " /" &安培; Now.Year

给出:

dd / mm / yy

-
-iwdu15
instead of using or changing the date, why not make your own?

Dim str as String = Now.Day & "/" & Now.Month & "/" & Now.Year

which gives:

dd/mm/yy

--
-iwdu15


Andreas,


奇怪,我可以向你保证肯和我在常规基础上安排课程。


他在美国,我在欧盟。我们从未对日期时间有任何问题。


这会很疯狂,因为在日期时间没有特殊的文化。

它是一个长的它持有一个100纳秒刻度的计数器,在基督教日历日期01/01/01 00:00:00开始

(净价)。在其他系统中

开始时间和完成方式可能会有所不同。


但是从来没有尝试将日期时间转换为字符串格式,原因还有其他原因$>
比显示那些。


我希望这会有所帮助,


Cor

" ;安德烈亚斯" <一个***** @ pandora.be> schreef in bericht

新闻:Od ********************** @ phobos.telenet-ops.be ...
Andreas,

Strange, I can assure you that Ken and I exhange programs on regular base.

He is in the US and I in the EU. We never had any problem with datetime.

That would be crazy because in datetime there is not in a special culture.
It is a "long" which holds a counter of 100 nanoseconds ticks that started
(in Net) at the Christian calendar date 01/01/01 00:00:00. In other systems
the starting time and way it is done can be different.

But never try to convert the datetime to string formats with another reasons
than to show those.

I hope this helps,

Cor
"andreas" <an*****@pandora.be> schreef in bericht
news:Od**********************@phobos.telenet-ops.be...
当我使用日期格式从一台带有Windows的PC复制一个vb.net项目时
日期格式为fe dd / mm / yyyy到格式为yy / mm / dd的另一台PC然后我得到错误。
如何在项目中更改vb.code中的日期格式(
不在Windows中)如何找出PC Windows使用的日期格式。
感谢您的回复
When I copy a vb.net project using date formats from one PC with a windows
date format f.e. dd/mm/yyyy to another PC having a format yy/mm/dd then I
get errors.
How can I change for a while in the project the date format in vb.code (
not in Windows) and how can I find out which date format the PC Windows is
using.
Thanks for any response



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

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