Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

Points for ozo

thanks for your input into the "time" question
maudib
0
maudib031397
Asked:
maudib031397
1 Solution
 
ozoCommented:
You're welcome.
I'm not sure if your question was completely answered,
If we consider 1971-11-03 to be the date of unix inception
http://www.de.freebsd.org/de/ftp/unix-stammbaum
Then you can find the local number of days since then with

use Time::Local;
$epoch=timelocal(0,0,0,3,11-1,1971-1900);
print int(((time)-$epoch)/86400);

#But to account for possible daylight savings time shifts,
#whether on the current day, the epoch day, or between,
#you may need something like:
$epochnoon=timelocal(0,0,12,3,11-1,1971-1900);
print int(((time+(12-(localtime)[2])*3600)-$epochnoon+43200)/86400)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now