// Get current block from ganache-cli let block = await web3.eth.getBlock('latest'); // Log initial timestamp -- logs 1535296387 console.log(block.timestamp); // Increase time by a huge amount simply to make it easier to distinguish // between the logged 10-digit numbers (this changes leading digit from a // 1 to a 2) await increaseTime(533868440); // Get the new block number (previous function also mines a block) block = await web3.eth.getBlock('latest'); // Log new timestamp from ganache-cli -- logs 2069164830 (this is updated) console.log(block.timestamp); // Log timestamp returned by the contract from a function that simply // returns "now" -- logs 1535298108 (this is not updated) console.log(String(await contract.getTime()));