Jump to content

Quick (probably simple) question about coding practice


Vince889

Recommended Posts

Hey guys,

 

Why exactly do people use multiplication when calculating time? Like when setting cookies, timeouts or something that requires second-based definitions.

 

For example, some do:

$thirty_days = time()+60*60*24*30;

 

As opposed to what I do:

$thirty_days = time()+2592000;

 

 

Why do they do that? Does it help them calculate it without a calculator? Make it easier to manage/adjust in the future? Personal preference? These are the only possible explanations I can think of. This has been bugging me for a while...am I doing something wrong?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.