adrianhajdin / project_crowdfunding

With a stunning design, connected to the blockchain, metamask pairing, interaction with smart contracts, sending Ethereum through the blockchain network, and writing solidity code.
https://jsmastery.pro
680 stars 372 forks source link

Deadline should be a date in the future !!! publishCampaign function, it's parse time is error in cource video!!! #78

Open cxp-13 opened 7 months ago

cxp-13 commented 7 months ago

Correct approach!!! Math.round(new Date(campaign.deadline) / 1000)

new Date(campaign.deadline).getTime()There will be 3 more zeros!!!

cxp-13 commented 7 months ago

const moonLanding = new Date('2024-01-12');

// Milliseconds since Jan 1, 1970, 00:00:00.000 GMT console.log(moonLanding.getTime()); // output: 1705017600000

cxp-13 commented 7 months ago

block.timestamp (uint): The timestamp of the current block, in seconds since Unix epoch