Hello good people! :)
As the title states, I want to get the difference (in seconds) between 2 (specifically between now and a date in the past) dates without using: strtotime, the Zend Framework or a PEAR package.
I don't want to get into the details of my reason but the gist of it is that I'm working with very old dates (and I do mean old, I'm talking before 0 A.D.).
It is preferred that the returned result be highly accurate down to the second of the textual timestamp given. The format to call the function should be similar to:
$bar = foo("YYYY-MM-DD HH:MM:SS", "AD"); // Where AD is Anno Domini
$baz = foo("YYYY-MM-DD HH:MM:SS", "BC"); // Where BC is Before Christ
The first person who offers a working that features:
- High readability
- No magic (ternary operators, etc.)
Will have their answer up-voted and accepted. Their name will be credited in the header of the source file which uses their code.
EDIT (Re: Fame):
Someone said having a name credited in the header looks bad and can be edited out. I'm talking about the header of the source file that utilizes the function I want. This isn't about "fame". Credit should be given where credit is due and I have no need to lie about who authored a work.
EDIT (Re: Accurateness):
No reason other than I want to keep with the "letter of the message" as best as I am able.
EDIT (Re: Magic):
Magic is different things to different people. In regards to the ternary operator, please respect my opinion as I respect yours. Thank you.
EDIT (Re: Old Dates and One Second Accuracy):
As a student of history, it makes sense to me. The desire for "one second accuracy" is not an absolute. Perfection, while attainable, is not required.