1

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?

Mattester
  • 11
  • 2
  • 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 06 '18 at 21:16

2 Answers2

0

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?

Tarik EN-NAKDI
  • 92
  • 1
  • 13
0

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

Jaime
  • 8,340
  • 1
  • 12
  • 20