473,480 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

day of week

Greetings

Could anyone kindly help me figure out how to add the day of the week to
David Spelts' Traffic Log "Hits By Day"?

I tried the following and could not implement any properly. I am a perl
newbie and would appreciate any help. I imagine this is simple for a perl
guru:

#$dayofweek = Date_DayOfWeek($month,$day,$year);
#my $date = ParseDateString("15 mar 1999");
$date = substr($key,0,6);
print UnixDate($date, "%a");
#$dayofweek = UnixDate($date, "%A");

#my $dt = DateTime->new(year =$year, month =$month, day =$day);
#my $dow = $dt->day_of_week();

#use Date::Calc; # you need this to calculate your date
#my $a = Date::Calc::Date_to_Text(2005, 12, 15);

I am using a Linux server with perl ver 5.8.7

all files required to run the script can be found here:
http://www.spelts.com/trafficlog/
Jan 27 '07 #1
2 7184
In article <_6******************************@comcast.com>, andy wrote:
Greetings

Could anyone kindly help me figure out how to add the day of the week to
David Spelts' Traffic Log "Hits By Day"?

I tried the following and could not implement any properly. I am a perl
newbie and would appreciate any help. I imagine this is simple for a perl
guru:

#$dayofweek = Date_DayOfWeek($month,$day,$year);
#my $date = ParseDateString("15 mar 1999");
What is the purpose of posting commented-out code?
$date = substr($key,0,6);
What is in $key?
print UnixDate($date, "%a");
What module implements UnixDate?
#$dayofweek = UnixDate($date, "%A");

#my $dt = DateTime->new(year =$year, month =$month, day =$day);
What module implements DateTime?
#my $dow = $dt->day_of_week();
What module implements day_of_week?
>
#use Date::Calc; # you need this to calculate your date
#my $a = Date::Calc::Date_to_Text(2005, 12, 15);
Finally, a clue as to which module you are attempting to use!
I am using a Linux server with perl ver 5.8.7

all files required to run the script can be found here:
http://www.spelts.com/trafficlog/
So you expect us to go to this website, download the program, install
it on our webserver, and test it? You must not want help very badly.

Maybe this will help:

#!/usr/local/bin/perl
use strict;
use warnings;
use Date::Calc qw(Day_of_Week);
my @days = qw( Sun Mon Tue Wed Thu Fri Sat );
my $dow =Day_of_Week(2005, 12, 15 );
print "Dec 15, 2005 is a $days[$dow]\n";
FYI: this newsgroup is defunct. Try comp.lang.perl.misc in the future
(but if you do, please read and comply with the guidelines for that
group).

Good luck.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Jan 29 '07 #2
LOL

"Jim Gibson" <jg*****@mail.arc.nasa.govwrote in message
news:29************************@mail.arc.nasa.gov. ..
In article <_6******************************@comcast.com>, andy wrote:
>Greetings

Could anyone kindly help me figure out how to add the day of the week to
David Spelts' Traffic Log "Hits By Day"?

I tried the following and could not implement any properly. I am a perl
newbie and would appreciate any help. I imagine this is simple for a perl
guru:

#$dayofweek = Date_DayOfWeek($month,$day,$year);
#my $date = ParseDateString("15 mar 1999");

What is the purpose of posting commented-out code?
>$date = substr($key,0,6);

What is in $key?
>print UnixDate($date, "%a");

What module implements UnixDate?
>#$dayofweek = UnixDate($date, "%A");

#my $dt = DateTime->new(year =$year, month =$month, day =$day);

What module implements DateTime?
>#my $dow = $dt->day_of_week();

What module implements day_of_week?
>>
#use Date::Calc; # you need this to calculate your date
#my $a = Date::Calc::Date_to_Text(2005, 12, 15);

Finally, a clue as to which module you are attempting to use!
>I am using a Linux server with perl ver 5.8.7

all files required to run the script can be found here:
http://www.spelts.com/trafficlog/

So you expect us to go to this website, download the program, install
it on our webserver, and test it? You must not want help very badly.

Maybe this will help:

#!/usr/local/bin/perl
use strict;
use warnings;
use Date::Calc qw(Day_of_Week);
my @days = qw( Sun Mon Tue Wed Thu Fri Sat );
my $dow =Day_of_Week(2005, 12, 15 );
print "Dec 15, 2005 is a $days[$dow]\n";
FYI: this newsgroup is defunct. Try comp.lang.perl.misc in the future
(but if you do, please read and comply with the guidelines for that
group).

Good luck.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Jan 30 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5197
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
21
1885
by: .:mmac:. | last post by:
I have to update a page every week. I get the page ahead of time so I used the "scheduled includes" webbot in Frontpage only to find that I would have to refresh the page every week to have it...
7
15133
by: Shuffs | last post by:
Could someone, anyone please tell me what I need to amend, to get this function to take Sunday as the first day of the week? I amended the Weekday parts to vbSunday (in my code, not the code...
14
5080
by: deko | last post by:
This runs, but does not narrow to current week. suggestions appreciated! SELECT lngEid, dtmApptDate, Subject, Appt_ID FROM qry002 WHERE (dtmApptDate BETWEEN DateAdd("d",-weekday()+2,) And...
5
3023
by: Peter Bailey | last post by:
I have a query that returns , and : 12/05/04 3 Wednesday 13/05/04 0 Thursday and so on what I would like to do now is count the number of bookings by week so from monday to...
9
3393
by: Ray | last post by:
I need to convert the normal calendar to show the week no., the period no. and the financial year. The financial year format is as follows:- Date start: 2 May, 2005 7 days a week, 4 weeks a...
3
6082
by: Steph. | last post by:
Hi, When I use the "Calendar.GetWeekOfYear" function (with "fr-BE" as CultureInfo and Monday as the first day of week) I get : Friday 31/12/2004 : week = 53
3
17303
by: Mal | last post by:
Hello, Any advice on a function to convert a given week number to a date? Ideally I'd like the first day of that week. I'm using this to compare year to year....using the week number as the...
6
25346
by: aarklon | last post by:
Hi folks, I found an algorithm for calculating the day of the week here:- http://www.faqs.org/faqs/calendars/faq/part1/index.html in the section titled 2.5 what day of the week was 2 august...
10
1251
by: Jim | last post by:
I'm sure this has been asked before but I can't find any postings. I have a table that has weekly inspections for multiple buildings. What I need to do is break these down by the week of the...
0
7051
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6915
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7054
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7097
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6750
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
2993
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
567
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.