0

Today is June 17. but when I execute my function and store the following arguments.

WriterModel(owner,postID, _postContent, now);

"now", It returns the July 20 timestamp.

It perfectly working fine in remix IDE which returns the today timestamp but in my local (Angular+Truffle + smart contract ) it returns July 20.

Can you please give me where I were Wrong.?

8
  • Are you using Ganache, Rinkeby...?
    – alberto
    Commented Jun 17, 2019 at 18:17
  • I am using Ganache
    – Suria
    Commented Jun 18, 2019 at 2:02
  • @Suria Check the computer clock in your pc is synchronized. Remember the timestamp returned is the unix time so it is in UTC.
    – Ismael
    Commented Jun 18, 2019 at 20:51
  • 1
    @Ismael , I have checked again there is no difference in my pc date and if it is UTC then the difference is just 5.30 hrs right ?
    – Suria
    Commented Jun 19, 2019 at 0:55
  • @phant0m can your please tell the other possibilities of storing time with that record ?
    – Suria
    Commented Jun 19, 2019 at 15:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.