![]() |
|
SPONSORED LINKS BY GOOGLE |
|
2
1st May 19:45
External User
Posts: 1
|
In microsoft.public.scripting.wsh message <1176483517.348992.33280@d57g2
000hsg.googlegroups.com>, Fri, 13 Apr 2007 09:58:37, Matty J <mattyjensen@gmail.com> posted: Then you can write the javascript to expect a string, or you can write the VBscript to provide a day or milliseconds number, which is better. If it is a current date/time, then you can get the JS to store the current Offset and let VB do the rest of the work. See via <URL:http://www.merlyn.demon.co.uk/vb-dates.htm>; consider the following as HTML including script. To link files, see <URL:http://www. merlyn.demon.co.uk/js-nclds.htm>. HTML: In ten microdays' time <script type="text/javascript"> function LZ(x) { return (x>=10||x<0?"":"0") + x } function LZZ(x) { return x<0||x>=100?""+x:"0"+LZ(x) } function CDateToUTCstr(CD) { var D = new Date(1899, 11, 30+Math.floor(CD), 0, 0, 0, 864e5*(CD%1)) with (D) return getUTCFullYear() + "-" + LZ(getUTCMonth()+1) + "-" + LZ(getUTCDate()) + " " + LZ(getUTCHours()) + ":" + LZ(getUTCMinutes()) + ":" + LZ(getUTCSeconds()) + "." + LZZ(getUTCMilliseconds()) } </script> it will be <script type="text/VBscript"> document.write CDateToUTCstr(Cdbl(Now + 1e-5)) </script> UTC. It's a good idea to read the newsgroup c.l.j and its FAQ. See below. -- (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6 news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>. <URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources. <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links. |
|
|
SPONSORED LINKS BY GOOGLE |
|
|