It is very simple, that you might not need a library, although there are cautions.

That is, using Date object. Be aware of months and leap years. Don't try to use straight simple approximation of raw milliseconds.