开发者

hot to date indide parameter in xml

i made this code for inserting data to an system mail that know to work with xml file. the problem is that i try to create some javascript code for getting the current date of day, and then put it inside the filed date, but without success.

i know hot create 开发者_运维技巧the date in javascript, my problem is in thx xml file, i mean how can i impplemt the date inside the filed date in the xml file.

the code(xml side):

123456

NOW COMPLETE ENGLISH

1274 liran **

413 3280 86308 ; UNIX email;dateofday liroy7@gmail.com;(i want here to return the date from the javascript)

thanks,


I'm not sure I understand, but you can use getTime() on your Date objec to insert it into the XML file as milliseconds, and if you need to convert it back into a JavaScript object you can parse it directly.

function putInXmlFile(d) {
  writeToXML(d.getTime());
}

function getFromXmlFile() {
  var date = new Date(getFromXML());
}

It works because the JavaScript Date object can parse from the milliseconds from the epoch (which is returned by getTime).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜