日期格式问题 - 快速问题 [英] date formatting question--quick one

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

问题描述

我知道我可以写一个,但是有一个内置的VBScript / ASP函数

取一个日期,格式为mm / dd / yyyy,并把它放在一个yymmdd

格式?

I know I could write one, but is there a built-in VBScript/ASP function to
take a date, which is in the format mm/dd/yyyy, and put it in a yymmdd
format?

推荐答案

不,vbscript没有像三色堇php这样的功能/>
语言。 :]

功能BetterDate()

Dim sDate

sDate =日期

BetterDate =右(年(sDate) ),2)&正确(0&月(sDate),2)&

正确(0&天(sDate),2)

结束功能


Response.Write BetterDate


你可能想要yyyy yyyy over yy。


Ray在家

" middletree" < MI ******** @ htomail.com>在消息中写道

news:eh ************** @ tk2msftngp13.phx.gbl ...
No, vbscript doesn''t have a function for everything like that pansy php
language. :]
Function BetterDate()
Dim sDate
sDate = Date
BetterDate = Right(Year(sDate), 2) & Right("0" & Month(sDate), 2) &
Right("0" & Day(sDate), 2)
End Function

Response.Write BetterDate

You may want to conder yyyy over yy though.

Ray at home
"middletree" <mi********@htomail.com> wrote in message
news:eh**************@tk2msftngp13.phx.gbl...
我知道我可以写一个,但有一个内置的VBScript / ASP函数来取一个日期,格式为mm / dd / yyyy,并将其格式化为yymmdd格式吗?
I know I could write one, but is there a built-in VBScript/ASP function to
take a date, which is in the format mm/dd/yyyy, and put it in a yymmdd
format?



谢谢!


得到yy,因为老板有特殊要求。


" Ray at<%= sLocation%>" < myFirstNameATlane34dotKOMM>在消息中写道

新闻:OW ************** @ tk2msftngp13.phx.gbl ...
thanks!

Gotta have the yy, because the boss has a special request.

"Ray at <%=sLocation%>" <myFirstNameATlane34dotKOMM> wrote in message
news:OW**************@tk2msftngp13.phx.gbl...
不,vbscript没有'没有像三色堇php语言那样的功能。 :]

功能BetterDate()
Dim sDate
sDate = Date
BetterDate = Right(Year(sDate),2)&正确(0&月(sDate),2)&
正确(0& Day(sDate),2)
结束功能

Response.Write BetterDate

你可能想要yyyy over yy。

Ray在家里

" middletree" < MI ******** @ htomail.com>在消息中写道
新闻:eh ************** @ tk2msftngp13.phx.gbl ...
No, vbscript doesn''t have a function for everything like that pansy php
language. :]
Function BetterDate()
Dim sDate
sDate = Date
BetterDate = Right(Year(sDate), 2) & Right("0" & Month(sDate), 2) &
Right("0" & Day(sDate), 2)
End Function

Response.Write BetterDate

You may want to conder yyyy over yy though.

Ray at home
"middletree" <mi********@htomail.com> wrote in message
news:eh**************@tk2msftngp13.phx.gbl...
我知道我可以写一个,但是有一个内置的VBScript / ASP函数
来取一个日期,格式为mm / dd / yyyy,并把它放在yymmdd
格式中?
I know I could write one, but is there a built-in VBScript/ASP function to take a date, which is in the format mm/dd/yyyy, and put it in a yymmdd
format?




>得到yy,因为老板有特殊要求。


告诉老板石器时代结束了。现在是时候记住导致Y2K问题的心态

,以及类似的心态

让人们试图弄清楚是否03 / 04/02是2002年3月4日,或者是2002年4月3日,或2003年4月2日,或2003年2月4日。
> Gotta have the yy, because the boss has a special request.

Tell the boss the stone age is over. It''s time to remember the mentality
that caused the Y2K problem in the first place, and a similar mentality that
gives people fits trying to figure out if 03/04/02 is March 4, 2002, or
April 3, 2002, or April 2, 2003, or Feb. 4, 2003.


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

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