This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: <MsSinceMidnight1Jan1970>1009843200000</MsSinceMidnight1Jan1970>
- From: "Chris Bayes" <chris at bayes dot co dot uk>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 17 Apr 2002 18:13:36 +0100
- Subject: RE: [xsl] <MsSinceMidnight1Jan1970>1009843200000</MsSinceMidnight1Jan1970>
- Reply-to: xsl-list at lists dot mulberrytech dot com
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@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com] On Behalf Of
> Dan Diebolt
> Sent: 17 April 2002 17:59
> To: 'xsl-list@lists.mulberrytech.com'
> 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