After finishing the breeding chapter in The Crypto Kitties course, I find that suddenly, we are presented with a chapter where, there is a Kitty Catalogue - already completed and Filip talks about it as if we had gone through it.
So I found the Moralis NFT Game tutorial which answers the topic of saving an NFT and making a cataloque of NFTs.
But I cannot get the current time to display properly. I get dates from 1970, even after following Filip’s code.
uint256 lastMeal, I get this date 1627013557
is
Mon Jan 19 1970 19:56:53
which comes from the block.timestamp
so basically, it is giving me the last meal time in 1970…?
anyone knows anything about this?
https://github.com/brlojam4932/NFT_GAMES_BL.git
[
'100',
'200',
'1627013557',
'100000',
damage: '100',
magic: '200',
lastMeal: '1627013557',
endurance: '100000'
]
I actually figured this out - by using Date.now(), wraped in newDate()
let deathTime = new Date(Date.now(parseInt(data.lastMeal) + parseInt(data.endurance) * 1000));
I was wrong about this - it didn’t really correct my time - it just made look right but Solidity time was still in the 1970s