datetime - Should I Calculate Time Values or Declare Them At The Start of My Code? -
tl;dr: whats better?
cookie_expires = time()+( (60*60*24)*31 )
vs.
cookie_expires = seconds_month
to save time , typing, years have been declaring useful time values @ start of apps.
seconds_hour = 3600 seconds_day = 86400 seconds_week = 604800 seconds_month = 2678400 seconds_year = 31557600
i wondering gurus here think. should not waste effort , calculate needed?
in opinion readability goes first:
"one_week_in_seconds" way better 60*60*24*7!
Comments
Post a Comment