Date Question -
I am fairly new in Perl, and Im thinking about creating a stats program. Now I havent had any experience with dates, so how would I get my program to know the date for each day? so that it can print out the hits for the specific site in that day?
------------------
___
/ \__ _ ___ ___
/ /\ / _` / __/ __
Anonymous posted this at 02:15 — 7th May 1999.
They have: 5,633 posts
Joined: Jan 1970
Nothing easier then that but there are many ways to do it.
If you have unix open a pipe to the /usr/bin/date/
Otherwise this always works:
# Stores Date and Tin in string format
$time = localtime (time);
# Splits it up in the different parts
($day, $mon, $dayNumber, $timeVal, $year) = split " ", $time, 5;
And next time you have a problem with Perl, safe yourself some time and look into the perl man pages.
If you have Windows, note that you can make a full text search with the search tool, so you can find the right man page.
Later,
Malte
PS: If you want a good stats program use hitbox.com + windows viewer -> I love it!!!
------------------
Malte Ubl
http://goKewl.com
Germany
Dass posted this at 23:06 — 7th May 1999.
They have: 109 posts
Joined: Apr 1999
So that will get the locoal time of where the server is located, or where the user is located?
Anonymous posted this at 23:28 — 7th May 1999.
They have: 5,633 posts
Joined: Jan 1970
This is the time of where the server is located.
I dont think there is a way to find out what time zone your visitor lives in, but maybe there is.
------------------
Malte Ubl
http://goKewl.com
Germany
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.