显示日期为mm / dd / yyyy [英] Display date as mm/dd/yyyy
问题描述
我有一个变量设置为:
vD1 = 2004/1/1
vD2 = 2004/1/15
我正在做if / then看看date()是否> VD2。如果是那么
response.write vD1& "到 &安培; vD2
当我写出变量时,它给我这些
日期的数值:
334到105.473684210526
如何将这些值转换为yyyy / mm / dd或dd / mm / yy ??????
"罗宾"写道......
我有一个变量设置为:
vD1 = 2004/1/1
vD2 = 2004/1/15
使用ASP还是从数据库中选择这些?
如果你正在使用''完全''以上你实际上是做数学
equasion:
2004除以1除以1等
如何将这些值转换为yyyy / mm / dd或dd / mm / yy ??????
请告知以上内容。
问候
Rob
" Robin" < RL ***** @ energymasterllc.com>在消息中写道
新闻:QO ****************** @ bignews1.bellsouth.net ..。I有一个变量设置为:
vD1 = 2004/1/1
vD2 = 2004/1/15
我正在做一个if / then看看是否date()是> VD2。如果是,那么
response.write vD1& "到 &安培; vD2
查看使用DateDiff函数:
http://www.devguru.com/Technologies/.../datediff.html
另外,请查看使用FormatDateTime函数:
http: //www.devguru.com/Technologies/...tdatetime.html
有关日期的更多信息...
http://www.aspfaq.com/show.asp?id=2313
问候,
Peter Foti
我想我真的需要了解更多关于sql / asp中的日期。
我尝试将变量设置为01/01/2004。和2004/01/01,但那些
被读作文本字符串,并不能真正用于比较日期。
我'我会读更多。谢谢!
" Robin" < RL ***** @ energymasterllc.com>在消息中写道
新闻:QO ****************** @ bignews1.bellsouth.net ..。I有一个变量设置为:
vD1 = 2004/1/1
vD2 = 2004/1/15
我正在做一个if / then看看是否date()是> VD2。如果是,那么
response.write vD1& "到 &安培; vD2
当我写出变量时,它给出了这些日期的数值:
334到105.473684210526
如何将这些值转换为yyyy / mm / dd或dd / mm / yy ??????
I have a variable that is set to:
vD1 = 2004/1/1
vD2 = 2004/1/15
I am doing an if/then that looks to see if date() is > vD2. If so then
response.write vD1 & " to " & vD2
When I write out the variables, it is giving me the numeric value of these
dates:
334 to 105.473684210526
How can I convert these values to either yyyy/mm/dd or dd/mm/yy??????
"Robin" wrote ...
I have a variable that is set to:
vD1 = 2004/1/1
vD2 = 2004/1/15
With ASP or are you picking these up from a database?
If you are using ''exactly'' the above you''d actually be doing a mathematical
equasion :
2004 divided by 1 divided by 1 etc
How can I convert these values to either yyyy/mm/dd or dd/mm/yy??????
Please advise as to the above.
Regards
Rob
"Robin" <rl*****@energymasterllc.com> wrote in message
news:QO******************@bignews1.bellsouth.net.. .I have a variable that is set to:
vD1 = 2004/1/1
vD2 = 2004/1/15
I am doing an if/then that looks to see if date() is > vD2. If so then
response.write vD1 & " to " & vD2
Look into using the DateDiff function:
http://www.devguru.com/Technologies/.../datediff.html
Also, look into using the FormatDateTime Function:
http://www.devguru.com/Technologies/...tdatetime.html
For more on dates...
http://www.aspfaq.com/show.asp?id=2313
Regards,
Peter Foti
I guess I just really need to learn more about date''s in sql/asp.
I tried setting the variables to "01/01/2004" and to "2004/01/01", but those
are read as text strings and can''t really be used to compare to a date.
I''ll read up more. Thanks!
"Robin" <rl*****@energymasterllc.com> wrote in message
news:QO******************@bignews1.bellsouth.net.. .I have a variable that is set to:
vD1 = 2004/1/1
vD2 = 2004/1/15
I am doing an if/then that looks to see if date() is > vD2. If so then
response.write vD1 & " to " & vD2
When I write out the variables, it is giving me the numeric value of these
dates:
334 to 105.473684210526
How can I convert these values to either yyyy/mm/dd or dd/mm/yy??????
这篇关于显示日期为mm / dd / yyyy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!