VbScript FormateDateTime函数显示两个文件的不同格式
我得到了下面的代码,其中我将格式化的日期和时间发送到我的XSLT,并将XML作为输出VbScript FormateDateTime函数显示两个文件的不同格式,vbscript,Vbscript,我得到了下面的代码,其中我将格式化的日期和时间发送到我的XSLT,并将XML作为输出 #importXSLT "tcm:228-190529-2048" As expandXSLT #importXSLT "tcm:228-642694-2048" As renderXSLT Dim xml, currentDateTime, datLong , datLongTime , fullDate Set xml = getNewDomDocument() xml.loadXML TDSE.Get
#importXSLT "tcm:228-190529-2048" As expandXSLT
#importXSLT "tcm:228-642694-2048" As renderXSLT
Dim xml, currentDateTime, datLong , datLongTime , fullDate
Set xml = getNewDomDocument()
xml.loadXML TDSE.GetListPublications(3)
expandXSLT.input = xml
Call expandXSLT.addParameter("publication", Component.Publication.Id)
expandXSLT.transform
xml.loadXML(expandXSLT.output)
'WriteOut xml.xml
currentDateTime = now()
datLong = FormatDateTime(currentDateTime, 1)
datLongTime = FormatDateTime(currentDateTime, 3)
fullDate = datLong &" "& datLongTime
renderXSLT.input = xml
Call renderXSLT.addParameter("currentPublishedDate", CStr(fullDate))
renderXSLT.transform
WriteOut renderXSLT.output
Set xml = Nothing
现在,上面对两个输出的XML进行日期格式化的逻辑是相同的,但令人惊讶的是,两个文件的输出都不同
第一个文件给出-2011年10月23日星期日上午8:52:36作为输出
第二个文件将-2011年10月23日09:14:45作为输出
#importXSLT "tcm:228-190529-2048" As expandXSLT
#importXSLT "tcm:228-642694-2048" As renderXSLT
Dim xml, currentDateTime, datLong , datLongTime , fullDate
Set xml = getNewDomDocument()
xml.loadXML TDSE.GetListPublications(3)
expandXSLT.input = xml
Call expandXSLT.addParameter("publication", Component.Publication.Id)
expandXSLT.transform
xml.loadXML(expandXSLT.output)
'WriteOut xml.xml
currentDateTime = now()
datLong = FormatDateTime(currentDateTime, 1)
datLongTime = FormatDateTime(currentDateTime, 3)
fullDate = datLong &" "& datLongTime
renderXSLT.input = xml
Call renderXSLT.addParameter("currentPublishedDate", CStr(fullDate))
renderXSLT.transform
WriteOut renderXSLT.output
Set xml = Nothing
请说明原因和解决方案,如果我想在2011年10月23日上午09:14:45输出两个文件,请提供更多信息
谢谢 在进行日期格式化之前,请尝试使用SetLocale2057之类的方法显式设置区域设置
2057是英国格式,似乎正是您想要的格式,否则请查看该格式以找到正确的值。您在什么环境下运行该格式?其Windows 7 Enterprise..请查看您正在查看的内容?我的意思是在ASP、Windows脚本主机、Internet Explorer等中?其ASP、IE7..如果需要更多内容,请告诉我?