# Can anyone explain this function and significance of 86400?

I have a function which is used to check if 90 days have been passed or not after staking, but I can't figure out why 86400 is mentioned, like is it seconds or minutes or anything else and how can I change that 90 days to any other value of my choice.

``````        function getTimePassedSinceStake(address _owner, uint256 _index)
public
view
returns (uint256)
{
return (block.timestamp - userInfo[_owner][_index].stakeTime) / 86400;
}
``````

From the documentation :

block.timestamp (uint): current block timestamp as seconds since unix epoch

So :

``````block.timestamp - userInfo[_owner][_index].stakeTime
``````

Is the number of seconds between `stakeTime` and `block.timestamp`. Dividing by 86400 is dividing by the number of seconds in a day (60 seconds * 60 minutes * 24 hours = 86400)

`````` return (block.timestamp - userInfo[_owner][_index].stakeTime) / 86400;
``````

returns the number of whole days between `stakeTime` and `block.timstamp` this has nothing to do with 90 days here.

An alternative syntax could be :

``````return (block.timestamp - userInfo[_owner][_index].stakeTime) / 1 days;
``````

how can I change that 90 days to any other value of my choice.

I found a contract with the same code here, that has the following `unstake` function with a 1 day limit :

``````function unStake(uint256 _index) external {
UserInfo storage userDetails = userInfo[unStaker][_index];
uint256 tokenId1 = userDetails.tokenId1;
uint256 timePassedSinceStaked = getTimePassedSinceStake(
unStaker,
_index
);
require(
timePassedSinceStaked >= 1,
"You can not unstake before 1 day"
);
userDetails = userInfo[unStaker][userInfo[unStaker].length - 1];
userInfo[unStaker].pop();

GemToken.claimByLuckyDragon(unStaker, 0);
emit UnStakedLuckyDragon(
unStaker,
tokenId1,
block.timestamp
);
}
``````

Here it is limiting to 1 day of waiting time, by changing :

``````require(
timePassedSinceStaked >= 1,
"You can not unstake before 1 day"
);
``````

to :

``````require(
timePassedSinceStaked >= 90,
"You can not unstake before 90 day"
);
``````

It would require 90 days, of course you can set the value of your choice.