๐ Get Second
6/17/25Less than 1 minute
๐ Get Second
Tips
This is usually used for setting cache expiration time, setting end time, and so on.
secondEndToday()
Get the number of seconds until midnight tonight
Parameters
nothing
Return Values
The number of seconds between this moment and 0:00 tonight
Example code
/* Get the number of seconds until midnight tonight */
TimeHelper::secondEndToday();
// 32811secondMinute()
Get the number of seconds for N minutes
- Parameter
| Parameter | Introduction | Require |
|---|---|---|
| minutes | The number of seconds for how many minutes to return | Optional, the default value is 1 |
Return Values
N minutes of seconds
Example code
/* Get 5 minutes of seconds */
TimeHelper::secondMinute(5);
// 300secondHour()
Get the number of seconds for N hours
Parameters
| Parameter | Introduction | Require |
|---|---|---|
| hours | The number of seconds for how many hours to return | Optional, the default value is 1 |
Return Values
The number of seconds for N hours
Example code
/* Get 10 hours of seconds */
TimeHelper::secondHour(10);
// 36000secondDay()
Get the number of seconds for N days
Parameters
| Parameter | Introduction | Require |
|---|---|---|
| days | The number of seconds of how many days to return | Optional, the default value is 1 |
Return Values
The number of seconds in N days
Example code
/* Get the number of seconds in 1 day */
TimeHelper::secondDay();
// 86400secondWeek()
Get the number of seconds for N weeks
Parameters
| Parameter | Introduction | Require |
|---|---|---|
| weeks | The number of seconds of how many weeks to return | Optional, the default value is 1 |
Return Values
N weeks of seconds
Example code
/* Get the seconds for 1 week */
TimeHelper::secondWeek(1);
// 604800