我需要按以下格式创建提取日期和时间。
extractDate='2011-10-18T12:00:00.000000'
最好的方法是什么,使用 vbscript / asp3 来做到这一点?我只是在考虑对 .000000 的结尾部分进行硬编码,因为这不是赛马哈哈
谢谢。
到目前为止,我从类似的东西开始;
xmlDateTime = FormatDateTime(Now(),0)
xmlDateTime = Replace(xmlDateTime, " PM", "")
xmlDateTime = Replace(xmlDateTime, " AM", "")
Response.Write xmlDateTime & "<br>"
更新:
我的潜在解决方案:
xmlDateTime = FormatDateTime(Now(),0)
xmlDateTime = Replace(xmlDateTime, " PM", "")
xmlDateTime = Replace(xmlDateTime, " AM", "")
Response.Write xmlDateTime & "<br>"
splitDateTime = Split(xmlDateTime, " ")
xmlDate = splitDateTime(0)
xmlTime = splitDateTime(1)
strYear = DatePart("yyyy",xmlDate)
strMonth = DatePart("m",xmlDate)
strDay = DatePart("d",xmlDate)
Response.Write strYear & "<br>"
Response.Write strMonth & "<br>"
Response.Write strDay & "<br>"
xmlDateTime = strYear & "-" & strMonth & "-" & strDay & "T" & xmlTime & ".000000"
Response.write xmlDateTime & "<br>"