Weired Excel time format - Blog - Open Source - - php, photography and private stuff

Weired Excel time format

I don't know, if that's common knowledge, but I found it very useful.

A friend of mine recently asked me, which internal date format M$ Excel uses (you all know that weired float numbers that appear if you reformat a date cell in Excel). After some searching and playing around he found out, how to convert those numbers to dates:

function xsltotime($value) { return date("d.m.Y - H:i:s",(($value - 25569)*86400)-7200); } $value = 38147.53801; // Date ix "Excel"-format echo xsltotime($value);

Maybe that's useful for anyone.

If you liked this blog post or learned something, please consider using flattr to contribute back: .



Add new comment

Fields with bold names are mandatory.