Subject: | Add method for converting to Unix epoch time |
Please consider adding an ->epoch method. (That is the “duck type” conventional name for the method that does this, as far I’ve found in a half-dozen CPAN datetime modules.)
I have found that a lot of modules have bugs in their strftime (or maybe not, but in any case they at least have *different* bugs from everyone else’s strftimes), whereas their ->epoch tends to be correct. Considering all the edge cases a ->strftime needs to account for, and how simple ->epoch’s job is in comparison, that’s really no surprise.
The combination of providing ->epoch and ->from_epoch makes it easy for code to be written to be datetime-module-agnostic.