Added the Time base library

Should we add a time base?

Implement similar to JavaScript getFullYear()、getMonth()、getDate()

In some scenarios involving real world time, but also need to be used in smart contracts, we often need it.

We have an on-chain timestamp to get the on-chain time, and we lack an entry point to get a day directly.

I would like to get more opinions on that, especially from Sophia devs (cc @radrow.chain, @ghallakaeternity.chain, @hanssv.chain).

in the sophia examples repo there is an old example for a DateTime lib, see:

tests are here:

1 Like

Sorry, forgot to write here - discussed it with @radrow.chain directly.

This sounds like a good library to have in the compiler if you ask me.

2 Likes