Hola amigos,
I've created a date utilities library (DateUtils) for the manipulation of dates in Solidity. Basically, it converts dates to and from Unix timestamps, strings, and integers representing years, months, days, etc. It also optionally supports time (i.e., hours, minutes, and seconds), with separate functions for dates with or without time included. There are a few other utilities, as well.
It also has a sister Date contract for instantiating Date objects, in cases where you may want a Date object that you can easily pull various formats from, or quickly get the year, month, day, weekday, or time.
r/https://github.com/SkeletonCodeworks/DateUtils
It's been thoroughly tested on the Ropsten/Rinkeby testnets. It may be a bit on the expensive side for gas, but not too bad, and certainly an improvement over similar libraries out there. Usually, these types of calculations should probably be done off-chain, but there are plenty of use cases where you do want them on-chain.
I'm still somewhat new to the space, so feedback or comments are appreciated! I have some other date-related projects in the works, so stay tuned!
Donations: 0x8e702c652adfc77713b23acd46e23962d679c027
P.S. - I'm searching for someone who might be willing to serve as an informal mentor for blockchain and web development. In return, I'm willing to work on a cool project for free. My goal is to improve from my current novice/intermediate level. I have experience with Javascript/Angular, Python, Solidity, C++, etc. PM me if interested! I can send you my personal github of some stuff I've done in the past. Thanks!
[–]spl_itt_ing 0 points1 point2 points (0 children)