简单的格式问题 [英] simple format question

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

问题描述

为了以CCYY-MM-DD方式创建日期,我曾经能够使用

格式(日期,yyyy)&" - && ;格式(月,mm)...语法...


这似乎不再适用于vb.net。我知道如何做到这一点...,

,前缀为0。到了这个月并且选择了正确的2个字符,但那个

很傻。


什么是新的简单方式?


是否列出了所有字符串和日期操作函数的列表

withold和新的某处方法?


谢谢!

In order to create a date in CCYY-MM-DD fashion, I used to be able to use
the Format(date,"yyyy")&"-"&Format(month,"mm")... syntax...

This no longer appears to work in vb.net. I know how I could do this...,
by prepending a "0" to the month and taking the right 2 characters, but that
is silly.

What is the new "easy" way ?

Is there a list some where of all the string and date manipulation functions
with "old" and "new" methods somewhere ?

Thanks !

推荐答案

" Rob" < ro *** @ yahoo.com写道

新闻:Xs **************************** **@comcast.com:
"Rob" <ro***@yahoo.comwrote in
news:Xs******************************@comcast.com:

为了以CCYY-MM-DD方式创建日期,我曾经能够

使用格式(日期,yyyy)&" - "& Format(月,mm)...语法...


这个似乎不再适用于vb.net。
In order to create a date in CCYY-MM-DD fashion, I used to be able to
use the Format(date,"yyyy")&"-"&Format(month,"mm")... syntax...

This no longer appears to work in vb.net.



你需要上限M'...


格式(现在,yyyy-MM-dd)

you need cap M''s...

format (Now, "yyyy-MM-dd")


MessageBox.Show(Format(DateTime.Now," yy-MM-dd"))


新手编码器

" tony obrien" < tob _ @ _ sourcecode-inc.comwrote in message

news:Xn **************************** *****@130.81.64 .196 ...
MessageBox.Show(Format(DateTime.Now, "yy-MM-dd"))

Newbie Coder
"tony obrien" <tob_@_sourcecode-inc.comwrote in message
news:Xn*********************************@130.81.64 .196...

" Rob" < ro *** @ yahoo.com写道

新闻:Xs **************************** **@comcast.com:
"Rob" <ro***@yahoo.comwrote in
news:Xs******************************@comcast.com:

为了以CCYY-MM-DD方式创建日期,我曾经能够

使用格式(日期,yyyy)&" - "& Format(月,mm)...语法...


这个不再适用于vb.net。

In order to create a date in CCYY-MM-DD fashion, I used to be able to
use the Format(date,"yyyy")&"-"&Format(month,"mm")... syntax...

This no longer appears to work in vb.net.



你需要上限M'...


format(现在,yyyy-MM-dd)


you need cap M''s...

format (Now, "yyyy-MM-dd")



这里有所有字符串和日期操作的列表

函数以及如何在Francesco Balena的书中使用它们,

VB2005:语言。这是一本很好的书,很多原因。很棒的参考。


另一本有趣的书是The .Net Languages:A Quick

翻译指南。作者:Brian Bischof。这有一堆常用代码的VB6,VB.Net,

和C#.Net语法,比如数据类型

和运算符,异常处理,类(以及所有这些)

涉及),事件,字符串管理,窗体表格,日期

和时间函数,匹配和财务计算,集合,

等我已经发现它非常有帮助。


唯一的问题是它可能适用于.Net 2002.但

我还是觉得它看起来很有帮助对于VB.Net和C#.Net之间的语法差异

(我永远不会记得如何使用C#转换
,或实现接口。叹气。)


Robin S.

----------------------------- -------

" Rob" < ro *** @ yahoo.com写了留言

新闻:Xs *************************** ***@comcast.com。 ..
There''s a list of all the string and date manipulation
functions and how to use them in Francesco Balena''s book,
VB2005:The Language. This is an excellent book for lots
of reasons. Great reference.

Another interesting book is "The .Net Languages: A Quick
Translation Guide" by Brian Bischof. This has VB6, VB.Net,
and C#.Net syntax for a bunch of common code, like data types
and operators, exception handling, classes (and all that
involves), events, string management, windows forms, date
and time functions, match and financial calcs, collections,
etc. I have found it very helpful.

The only gotcha is that it''s probably for .Net 2002. But
I still find it helpful when just looking for syntax diffs
between VB.Net and C#.Net (I can''t ever remember how to
cast in C#, or implement interfaces. Sigh.)

Robin S.
------------------------------------
"Rob" <ro***@yahoo.comwrote in message
news:Xs******************************@comcast.com. ..

为了以CCYY-MM-DD方式创建日期,我曾经能够使用

格式( date,yyyy)&" - "& Format(month," mm")... syntax ...


这似乎不再起作用了在vb.net中。我知道如何做到这一点...,

,前缀为0。到了月份,并且选择了正确的2个字符,但

这是愚蠢的。


什么是新的简单方式?


是否列出了所有字符串和日期操作的列表

与old相关的函数和新的某处方法?


谢谢!
In order to create a date in CCYY-MM-DD fashion, I used to be able to use
the Format(date,"yyyy")&"-"&Format(month,"mm")... syntax...

This no longer appears to work in vb.net. I know how I could do this...,
by prepending a "0" to the month and taking the right 2 characters, but
that is silly.

What is the new "easy" way ?

Is there a list some where of all the string and date manipulation
functions with "old" and "new" methods somewhere ?

Thanks !



这篇关于简单的格式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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