To
SDF? Using XHTML? XHTML is a content description language, and has no imperatives, nor facilities for data conversion.
If you can use Javascript (for example, if the XHTML is to be displayed in a standard web browser), you can create a
Date object for the conversion:
Code:
var date = new Date(1000 * epoch);
var text = date.toString();
The current UNIX epoch time is seconds since 1970-01-01 00:00:00 UTC; Javascript uses milliseconds since the same epoch. That's where the multiply-by-thousand comes from.
If you encapsulate the epoch times in the XHTML content using for example a
<span class="datemagic">epoch</span>, you should be able to use the onLoad handler for the body element to run a Javascript function that uses the Javascript DOM to convert the epoch numbers to a human-readable string in local time. (It would also mean that without Javascript, users would see the epoch numbers instead.) Although dynamic HTML is not recommended at all with XHTML content, in this case only the plain text string would be modified, and it should be completely safe.
Actually, it might be pretty nifty in any case: the page could display the times in local time, without any intervention from the server.
1327486488 seconds since epoch is "Wed Jan 25 10:14:48 2012 UTC", but I have no idea what the 676088 refers to, or how it affects the date.