Re: perl - MySQL - getting the day of the week

  • From: "Lamar Upshaw" <lupshaw@xxxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 4 Dec 2008 13:39:24 -0800

Thank you for this. What I'm trying to do is put this in to a variable:
my $date = "Thu, 4 Dec 2008";

Some things about perl, I still don't quite understand, and I've learned everything from the web and this list, so please forgive me for being a bit slow. *smile*
Can I say:
my $date = > printf("%s, %d %s %d", $dt->day_abbr, $dt->day, $dt->month_abbr, $dt->year);

With All Respect,
Upshaw, Lamar T


----- Original Message ----- From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Thursday, December 04, 2008 12:49 PM
Subject: Re: perl - MySQL - getting the day of the week


As you may know, there are very many ways to do this.

One of them is to do:

use DateTime;

my $dt = DateTime->new(year => 2008, month => 12, day => 4);

printf("%s, %d %s %d", $dt->day_abbr, $dt->day, $dt->month_abbr, $dt->year);

#It will print:
Thu, 4 Dec 2008

Octavian

----- Original Message ----- From: "Lamar Upshaw" <lupshaw@xxxxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Thursday, December 04, 2008 9:08 PM
Subject: perl - MySQL - getting the day of the week


I'm using MySQL to get the current date with perl. I know how I can take a date, and convert it to readable calendar info:
2008-12-04 => Dec, 4 2008

My question is, how do I get perl to:
print "Thu, 4 Dec 2008";

It's the day of the week I'm after.

With All Respect,
Upshaw, Lamar T __________
View the list's information and change your settings at //www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: