1

I want to set up a voting system where, as soon as it starts, the user can see on what date the voting started. Demonstrating, voting started on 2022/10/07 at 18:40

lin3d
  • 11
  • 2

1 Answers1

2

You can use this library to convert timestamp to datetime https://github.com/RollaProject/solidity-datetime#timestamptodatetime

function timestampToDateTime(uint timestamp) public pure returns (uint year, uint month, uint day, uint hour, uint minute, uint second)
Stephen
  • 31
  • 2