'How to understand the meaning of a part of this contract

I have this command, I don't know what it means:

startUNIX = block.timestamp.add(365 days);

Full code:

enter image description here



Solution 1:[1]

block.timestamp is a read-only global variable returning the datetime of when the block exeucting this function was mined.

The add() function is most likely from the SafeMath library added through the "using for" expression. Example:

library Safemath {
    function add(uint256 a, uint256 b) public pure returns (uint256) {
        // ...
    }
}

contract MyContract {
    using SafeMath for uint256;
}

days is a Solidity unit, effectively just calculating the amount of seconds from the number of days, so it's easier to calculate time difference.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Petr Hejda