Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to count number of days in calender year? like, today's 199 of 365

Status
Not open for further replies.

spewn

Programmer
Joined
May 7, 2001
Messages
1,034
i saw a module called tivoli, but i don't have that on the server...i know how to get the day, month, year, etc...but how to know what day number today is out of the calendar...any ideas?

i'm saving items in a db, and i want to count the number of days ago a certain item was added...

- g
 
it's returned by the localtime function:

Code:
my $yday = (localtime(time))[7];
print $yday;

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
There are also datetime modules that will allow you do to date date calculations like 4/13/07 - 3/23/07 = x number of days
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top