XSLT/Flexible Format feeds, how to convert dates from unix/epoch time?

I love the Flexible Format feeds for syndication (https://knowledge.kaltura.com/how-create-custom-mrss-using-flexible-feed-xslt), but one issue I’ve had is that the Kaltura base feeds provide the dates in unix time. Since the XSLT is restricted to 1.0, which features no datetime support, it makes working with these values more difficult. Does anyone have any recommendations for being able to convert this data to something like preferably RFC-822, or any other more readable date format? I’ve found a few namespaces that used to address this, but it seems like thye are mostly 404s now. I could do the math myself, but I’d prefer not to if possible. If I do have to do the math, does anyone have any resources to help me out?

TL;DR, how can I convert a unix/epoch date like 1476139632 and convert it to a human readable date with XSLT 1.0?


Take a look at http://stackoverflow.com/a/5174870

1 Like

Brilliant! Thanks. Did not expect to be able to use php functions with XSLT 1.0. I’m surprised I didn’t find this solution sooner. I’m pretty sure I was on that thread, just didn’t look that far down after trying a few other solutions from it.

Don’t worry about it, we all miss from time to time:)