|
Subject: RE: [xsl] <MsSinceMidnight1Jan1970>1009843200000</MsSinceMidnight1Jan1970> From: "Chris Bayes" <chris@xxxxxxxxxxx> Date: Wed, 17 Apr 2002 18:13:36 +0100 |
Yeh new date needs an int
So
<html>
<head>
<script language="JavaScript">
function fixupDates(obj){
var d = new Date(parseInt(obj.innerHTML));
obj.innerHTML = d.toString();
}
</script>
</head>
<body onload="fixupDates(document.getElementById('theDateField'))">
<div id="theDateField">1009843200000</div>
</body>
</html>
Or use inline script
<html>
<head>
</head>
<body>
<table>
<tr>
<td>something</td>
<td><script type="text/javascript">document.write(new
Date(1009843200000).toString());</script><td>
</tr>
<tr>
<td>something</td>
<td><script type="text/javascript">document.write(new
Date(1009843207777).toString());</script><td>
</tr>
<tr>
<td>something</td>
<td><script type="text/javascript">document.write(new
Date(1099843200000).toString());</script><td>
</tr>
<tr>
<td>something</td>
<td><script type="text/javascript">document.write(new
Date(1509843200000).toString());</script><td>
</tr>
</table>
</body>
</html>
Ciao Chris
XML/XSL Portal
http://www.bayes.co.uk/xml
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
> Dan Diebolt
> Sent: 17 April 2002 17:59
> To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
> Subject: RE: [xsl]
> <MsSinceMidnight1Jan1970>1009843200000</MsSinceMidnight1Jan1970>
>
>
> I would need to do this to every instance of <MsSinceMidnight1Jan1970>
> not just the one with a specific id. BTW, the following code displays
> NaN for me:
>
> <html>
> <head>
> <script language="JavaScript">
> function fixupDates(obj){
> var d = new Date(obj.innerHTML);
> obj.innerHTML = d.toString();
> }
> </script>
> </head>
> <body onload="fixupDates(document.getElementById('theDateField'))">
> <div id="theDateField">1009843200000</div>
> </body>
> </html>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] <MsSinceMidnight1Jan1970>, Dan Diebolt | Thread | RE: [xsl] <MsSinceMidnight1Jan1970>, Dan Diebolt |
| RE: [xsl] perhaps OT: ?s on native , Michael Kay | Date | [xsl] Re: XSL-List Digest V4 #275, David Chryst |
| Month |