I want an to use an oracle to prevent contract interaction after certain time cutoffs

This is the APIs format:

"event":"event2","timezone":"UTC+1","datetime":"2018-06-07 01:00:00"

I think doing all of the calculation in the contract would be very expensive to convert to unix time/bytes and is seems complicated with timezones.

I cannot change the API (not my API), I would prefer to not build my own API.

Does anyone have any thoughts on how to handle this?

  • I don't see any right solution to this. I would make a proxy that format the datetime (timestamp) and connect Oraclize to the proxy. – Greg Jeanmart Jun 6 '18 at 21:16

You may think about using a timestamp to control the date of each Transaction. here is a similar topic about that: Solidity: Is there a way to get the timestamp of a transaction that executed?


I think the oracle is not needed. You could just save as a constant the timestamps after which the function will not be executed and require(now < contantTimeStamp)

Hope this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.