This topic has been archived. It cannot be replied.
-
枫下家园 / 电脑用户 / 请问DX一个ASP问题,如何把date()函数得到的值如2002-6-22转换成象20020622的格式?谢谢!
-pcrabbit(钱不够花);
2002-6-22
(#594197@0)
-
是不是可以先转成string再replace掉里面的东西,月日不足两位补零? 麻烦
-expertune(伪劣砖家);
2002-6-22
(#594206@0)
-
最好是用几个函数组合起来可以完成这个功能,就是不知道应该用哪个函数。
-pcrabbit(钱不够花);
2002-6-22
(#594208@0)
-
看看FORMAT里有没有这个选项
-ningxin0809(菊扇);
2002-6-22
(#594215@0)
-
1。确信用date()的得到的函数的格式是2002-6-22还是2002-06-22。2。格式若为后者,是否可以用下面的函数得到=left(**,4) & middle (**, 6, 2) & right(**, 2). 3.嗬嗬,我是按照sql来解决问题的,不置可否用在asp中。
-lilyba(Sunshine);
2002-6-22
(#594221@0)
-
stringDate=format(date, "YYYYMMDD")
-shanxiren(山西同乡会);
2002-6-22
(#594223@0)
-
不成,vbscript里面没有fomat这个函数
-pcrabbit(钱不够花);
2002-6-22
(#594229@0)
-
那就写个组件嘛
-expertune(伪劣砖家);
2002-6-22
(#594232@0)
-
分别取年,月,日,转成string以后联起来。
-henhen(哼哼~~,找工ing~~~~);
2002-6-22
(#594233@0)
-
关键取回来的月份是个1位数,怎么转成2位数。
-pcrabbit(钱不够花);
2002-6-22
(#594237@0)
-
if 一下嘛, 加零嘛...着急ing
-expertune(伪劣砖家);
2002-6-22
(#594239@0)
-
老大,我是在一个表单里面给出一个初始值,不用if语句那么复杂吧?
-pcrabbit(钱不够花);
2002-6-22
(#594242@0)
-
year(date) & int(month(date)/10) & right(month(date),1) & int(day(date)/10) & right(day(date),1)
-guestagain(guest again);
2002-6-22
(#594283@0)
-
不错
-expertune(伪劣砖家);
2002-6-22
(#594298@0)
-
可惜比起下面的,还是太复杂了。
-guestagain(guest again);
2002-6-22
(#594317@0)
-
转换的时候,函数中应该有个参数指明几位或称为几个字符。
-henhen(哼哼~~,找工ing~~~~);
2002-6-22
(#594265@0)
-
应该是这样
-xanada(㊣流水);
2002-6-22
{533}
(#594235@0)
-
真不错。
-lilyba(Sunshine);
2002-6-22
(#594244@0)
-
水平真高,但是还有个问题,编译出来的activex dll在server上面怎么注册?我是租用的空间。
-pcrabbit(钱不够花);
2002-6-22
(#594250@0)
-
没戏.
-expertune(伪劣砖家);
2002-6-22
(#594253@0)
-
嘿嘿,过奖。这个我也不知了,当初我是直接跑到我们的server上弄的,最后在安装说明书里写明就是了。不过我想你可以和host的tech support联系一下,也许可以。
-xanada(㊣流水);
2002-6-22
(#594257@0)
-
谢谢了,估计不成,当初想让他们给我加个系统DSN都不行,搞的我现在只能手写代码。我只是用access数据库啊......
-pcrabbit(钱不够花);
2002-6-22
(#594267@0)
-
张地些. :)
-jzwang(hello);
2002-6-22
(#594260@0)
-
唉,才涨列一哈奏让你打压列
-xanada(㊣流水);
2002-6-22
(#594263@0)
-
莫油,莫油.
-jzwang(hello);
2002-6-22
(#594270@0)
-
FormatDateTime
-antmm(xiao ant);
2002-6-22
(#594240@0)
-
formatdatetime也不成,使用vbLongDate参数和vbShortDate参数都无法得到yymmdd的格式。
-pcrabbit(钱不够花);
2002-6-22
(#594246@0)
-
想起来了,当时好象是用DatePart分别取出年,月,日,然后拼一块.
-antmm(xiao ant);
2002-6-22
(#594254@0)
-
又出新问题,如何用datepart得到年、月或者日?直接写datepart(m,date())就报错。
-pcrabbit(钱不够花);
2002-6-22
(#594301@0)
-
用lilyba的办法挺好。year(date) *10000 + month(date)*100+day(date)
-guestagain(guest again);
2002-6-22
(#594311@0)
-
可以得到分别得到年月日么?如果可以可否这样:年*10000+月*100+日。
-lilyba(Sunshine);
2002-6-22
(#594262@0)
-
faint
-pcrabbit(钱不够花);
2002-6-22
(#594269@0)
-
对还是不对,你就先倒了。
-lilyba(Sunshine);
2002-6-22
(#594273@0)
-
你真可爱.我估计你也是混在我党队伍里的.:D
-jzwang(hello);
2002-6-22
(#594280@0)
-
赫赫,我还是不知道
-lilyba(Sunshine);
2002-6-22
(#594294@0)
-
还是你这个简单,我想得太复杂了。
-guestagain(guest again);
2002-6-22
(#594300@0)
-
有底了,谢谢
-lilyba(Sunshine);
2002-6-22
(#594309@0)
-
报告大家一个好消息,通过集思广益,终于搞定,结果是这样的:Year(date)*10000+month(date)*100+day(date),万分感谢!
-pcrabbit(钱不够花);
2002-6-22
(#594318@0)
-
您那结果是数字类型,最好用字符串,也可以写成:String(4,Year(date))+String(2,month(date))+String(2,day(date))
-antmm(xiao ant);
2002-6-23
(#595237@0)