# What does this code return? block.timestamp / 1 days

``````function today() private view returns (uint256) {
return block.timestamp / 1 days;
}
``````

Why do we need this function?

it will return how many days passed since 1/1/1970

1 days = 86400 second Epoch = 1531409238 second

Epoch/1 days= 17724 days, 15 hours, 26 minutes and 40 seconds.

This will help you to know in which day /date are you when we run this function 1970+17724 day

`block.timestamp` according to the Solidity documentation is current block timestamp as seconds since unix epoch.

`days` is a time unit built into Solidity

Dividing the time in seconds by 1 day worth of seconds returns you today

• block.timestamp = 1 531 399 433 seconds 1 day = 86400 seconds 1 531 399 433 / 86400 = 17724.5304745 seconds Dividing the time in seconds by 1 day worth of seconds returns you today. What do you mean by "returns you today"? Jul 12, 2018 at 15:34
• Every perfect 'day' since the Unix epoch can be represented as an integer. A 'perfect day' in this scenario is something with time exactly 00:00:00 The block timestamp 1 531 399 433 is not a perfect day. The integer part of the division, 17724, is the day since the unix epoch and the decimal part represents the specific time Jul 12, 2018 at 15:45