Skip to content

Commit

Permalink
Merge pull request #5 from DaoCasino/fix-time-source
Browse files Browse the repository at this point in the history
change time source in config
  • Loading branch information
algys authored Sep 18, 2020
2 parents 960bfa5 + 6b39f70 commit dcb0854
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion conf.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
2 changes: 1 addition & 1 deletion src/oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export class Oracle {
public async getTime(): Promise<number> {
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;
}
Expand Down

0 comments on commit dcb0854

Please sign in to comment.