diff --git a/conf.json.example b/conf.json.example index c722581..538572e 100755 --- a/conf.json.example +++ b/conf.json.example @@ -9,5 +9,5 @@ "ethContractAddress": "0x8895345ad1c1a2bff799a575f83d89669ba4bce3", "Contract": "eosio.bridge", "blocksBehind": 0, - "clockApi": "http://worldclockapi.com/api/json/utc/now" + "clockApi": "http://worldtimeapi.org/api/timezone/Etc/UTC" } diff --git a/src/oracle.ts b/src/oracle.ts index 724ca23..ad5924f 100755 --- a/src/oracle.ts +++ b/src/oracle.ts @@ -166,7 +166,7 @@ export class Oracle { public async getTime(): Promise { const res = await fetch(this.clockApi); const time = await res.json(); - const date = new Date(time.currentDateTime.replace('Z', ':00.000')); + const date = new Date(time.utc_datetime); this.timeOffset = date.getTimezoneOffset() * 60000; return date.getTime() - this.timeOffset; }