Ask a Question related to PERL Beginners, Design and Development.
-
Neill Taylor #1
Covert Date to week number
Is their a way in PERL to covert a date to a week number
Cheers
Neill
********************
IMPORTANT NOTICE This email (including any attachments) is meant only for the intended recipient. It may also contain confidential and privileged information. If you are not the intended recipient, any reliance on, use, disclosure, distribution or copying of this email or attachments is strictly prohibited. Please notify the sender immediately by email if you have received this message by mistake and delete the email and all attachments.
Any views or opinions in this email are solely those of the author and do not necessarily represent those of Trinity Mirror PLC or its associated group companies (hereinafter referred to as "TM Group"). TM Group accept no liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Although every reasonable effort is made to keep its network free from viruses, TM Group accept no liability for any virus transmitted by this email or any attachments and the recipient should use up-to-date virus checking software. Email to or from this address may be subject to interception or monitoring for operational reasons or for lawful business practices.
Trinity Mirror PLC is the parent company of the Trinity Mirror group of companies and is registered in England No 82548, with its address at One Canada Square, Canary Wharf, London E14 5AP.
********************
Neill Taylor Guest
-
#39912 [NEW]: date('W') returns wrong week number for some dates
From: pkus at epf dot pl Operating system: windows xp PHP version: 5.2.0 PHP Bug Type: *General Issues Bug description: ... -
Date Range from Week Number
Has anyone ever tried to create a date range from a week number? Here is my scenario: I have a database with a primary key of weekNum. There are... -
Code for telling the week number on a specific date
I've been annoyed that the Date class had no ability to tell which week a certain date fell within. So I created a function that will take any date... -
Convert Date to week number
Tim wrote: ISO8601 defines a standard, but not everyone follows it. See: ... -
Parsing a date from the week number of a given year from request post
I'm trying to get the date from a request-query post that contains a year (request("season") and a week number from that year... -
Luke Bakken #2
RE: Covert Date to week number
> -----Original Message-----
Date::Calc has what you're looking for -> Week_of_Year()> From: [email]neill.taylor@trinityst.co.uk[/email]
> [mailto:neill.taylor@trinityst.co.uk]
> Sent: Thursday, January 22, 2004 11:28 AM
> To: [email]beginners@perl.org[/email]
> Subject: Covert Date to week number
>
>
> Is their a way in PERL to covert a date to a week number
>
>
> Cheers
>
> Neill
Luke Bakken Guest
-
Dan Muey #3
RE: Covert Date to week number
>
Sure , why not? You'd need to know the date format to start of course.> Is their a way in PERL to covert a date to a week number
>
I don't mess with dates personally a lot so I'd say have
a look on search.cpan.org for a module to do that.
Also perldoc may be able to help you.
Sorry to be so vague, just wanted to givve you a place to start looking.
DMuey
>
> Cheers
>
> NeillDan Muey Guest
-
Tim Johnson #4
RE: Covert Date to week number
Check out Time::Local. It makes it easy to break down a formatted date
field and put it into Perl time format.
-----Original Message-----
From: [email]neill.taylor@trinityst.co.uk[/email] [mailto:neill.taylor@trinityst.co.uk]
Sent: Thursday, January 22, 2004 11:28 AM
To: [email]beginners@perl.org[/email]
Subject: Covert Date to week number
Is their a way in PERL to covert a date to a week number
Tim Johnson Guest
-
Owen #5
Re: Covert Date to week number
On Thu, 22 Jan 2004 19:28:24 +0000
[email]neill.taylor@trinityst.co.uk[/email] wrote:
Try this;> Is their a way in PERL to covert a date to a week number
>
#!/usr/bin/perl
use Date::Calc qw(Week_Number Week_of_Year);
@t=localtime;
$week = Week_Number($t[5]+1900,$t[4]+1,$t[3]); #Deprecated
print " From Date::Calc Week Number is $week \n";
($week,$year) = Week_of_Year($t[5]+1900,$t[4]+1,$t[3]); #Preferred
print " From Date::Calc Week of Year is $week \n";
> Cheers
>
> Neill
>
>
>
>
>
> ********************
> IMPORTANT NOTICE This email (including any attachments) is meant only for the intended recipient. It may also contain confidential and privileged information. If you are not the intended recipient, any reliance on, use, disclosure, distribution or copying of this email or attachments is strictly prohibited. Please notify the sender immediately by email if you have received this message by mistake and delete the email and all attachments.
>
> Any views or opinions in this email are solely those of the author and do not necessarily represent those of Trinity Mirror PLC or its associated group companies (hereinafter referred to as "TM Group"). TM Group accept no liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Although every reasonable effort is made to keep its network free from viruses, TM Group accept no liability for any virus transmitted by this email or any attachments and the recipient should use up-to-date virus checking software. Email to or from this address may be subject to interception or monitoring for operational reasons or for lawful business practices.
>
> Trinity Mirror PLC is the parent company of the Trinity Mirror group of companies and is registered in England No 82548, with its address at One Canada Square, Canary Wharf, London E14 5AP.
> ********************
>
> --
> To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
> For additional commands, e-mail: [email]beginners-help@perl.org[/email]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>
--
Owen
Owen Guest
-
Randal L. Schwartz #6
[meta] Please delete boilerplate! (was Re: Covert Date to week number)
>>>>> "Neill" == Neill Taylor <neill.taylor@trinityst.co.uk> writes:
Neill> Is their a way in PERL to covert a date to a week number
Neill> Cheers
Neill> Neill
Neill> ******************** IMPORTANT NOTICE This email (including any
Neill> attachments) is meant only for the intended recipient. It may
Neill> also contain confidential and privileged information. If you
Neill> are not the intended recipient, any reliance on, use,
Neill> disclosure, distribution or copying of this email or
Neill> attachments is strictly prohibited. Please notify the sender
Neill> immediately by email if you have received this message by
Neill> mistake and delete the email and all attachments.
Neill> Any views or opinions in this email are solely those of the
Neill> author and do not necessarily represent those of Trinity Mirror
Neill> PLC or its associated group companies (hereinafter referred to
Neill> as "TM Group"). TM Group accept no liability for the content of
Neill> this email, or for the consequences of any actions taken on the
Neill> basis of the information provided, unless that information is
Neill> subsequently confirmed in writing. Although every reasonable
Neill> effort is made to keep its network free from viruses, TM Group
Neill> accept no liability for any virus transmitted by this email or
Neill> any attachments and the recipient should use up-to-date virus
Neill> checking software. Email to or from this address may be subject
Neill> to interception or monitoring for operational reasons or for
Neill> lawful business practices.
Neill> Trinity Mirror PLC is the parent company of the Trinity Mirror
Neill> group of companies and is registered in England No 82548, with
Neill> its address at One Canada Square, Canary Wharf, London E14 5AP.
Neill> ********************
Let's see the stats:
Number of lines of original question: 1
Number of lines of closing salutation: 1
Number of lines of sig: 2
Number of lines of COMPLETELY USELESS LEGAL DISCLAIMER: 27 lines after wrapping
Here's my boilerplate to reply to your boilerplate:
You have exceeded the 4-line .sig boilerplate limit with a worthless
unenforcable disclaimer. Please remove this text from future postings
to this mailing list. If you cannot do so for mail from your domain,
please get a freemail account and rejoin the list from there.
And I do this publicly so that it goes into the archives, so others
will also see that people *do* object to these things, and that there
*is* a ready solution to it.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Randal L. Schwartz Guest
-
Rob Dixon #7
Re: Convert Date to week number
Neill Taylor wrote:
Why not write it yourself?>
> Is their a way in PERL to covert a date to a week number
You need to know:
- Which day of the week is the 'first'.
- Which was the first week of the year that had four or more days.
That's week one.
Then do the sums/arithmetic/math/mathematics/calculations (what /do/
people prefer?)
BTW I agree wholeheartedly with Randal. He may be a Yank but he's
not all bad :) I'm surprised the Mirror legaloids can be such
idiots. Sometimes I wish I could be anational instead of being
branded with rubbish like this. At least I read the Independent
instead!
Rob
Rob Dixon Guest
-
Tim #8
Re: Convert Date to week number
At 03:16 PM 1/23/04 +0000, you wrote:
This message thread made me curious about just what constitutes the first>...
>Why not write it yourself?
>
>You need to know:
>
>- Which day of the week is the 'first'.
>
>- Which was the first week of the year that had four or more days.
> That's week one.
>
>Then do the sums/arithmetic/math/mathematics/calculations (what /do/
>people prefer?)
>
>.....
>Rob
week of the year. Is there a standard definition or are we making one here?
Tim
Tim Guest
-
Rob Dixon #9
Re: Convert Date to week number
Timwrote:
I got this from the British 'Letts' diary manufacturer about ten years back.>
> At 03:16 PM 1/23/04 +0000, you wrote:>> >...
> >Why not write it yourself?
> >
> >You need to know:
> >
> >- Which day of the week is the 'first'.
> >
> >- Which was the first week of the year that had four or more days.
> > That's week one.
> >
> >Then do the sums/arithmetic/math/mathematics/calculations (what /do/
> >people prefer?)
> This message thread made me curious about just what constitutes the first
> week of the year. Is there a standard definition or are we making one here?
Clearly it makes sense, as a week is, usefully, an odd number of days long
and can be assigned into either one year or the other. The big difference
is on which day a week starts, which is both nationally and culturally
variant.
Rob
Rob Dixon Guest
-
John McKown #10
Re: [meta] Please delete boilerplate! (was Re: Covert Date to week number)
Unfortunately, if the person is writing from work, the disclaimer is
likely required by his employer. I know that I have a similar one at work.
And not including it is grounds for termination <stupid>.
The only way around this is to use a personal email, like I do. But he may
need the help for work and at work. Supposedly, I cannot use my personal
email from work. But I know ways and means around it and am stealthy
enough that I am not likely to get caught.
I'm sitting at work now, but using my home email.
--
Maranatha!
John McKown
John McKown Guest
-
Levon Barker #11
Re: [meta] Please delete boilerplate! (was Re: Covert Date to week number)
Except that John's boss is on the list too!
On Fri, 2004-01-23 at 14:37, John McKown wrote:> Unfortunately, if the person is writing from work, the disclaimer is
> likely required by his employer. I know that I have a similar one at work.
> And not including it is grounds for termination <stupid>.
>
> The only way around this is to use a personal email, like I do. But he may
> need the help for work and at work. Supposedly, I cannot use my personal
> email from work. But I know ways and means around it and am stealthy
> enough that I am not likely to get caught.
>
> I'm sitting at work now, but using my home email.
>
> --
> Maranatha!
> John McKown
>
>Levon Barker Guest
-
John McKown #12
Re: [meta] Please delete boilerplate! (was Re: Covert Date to week number)
On Fri, 23 Jan 2004, Levon Barker wrote:
No, my boss is not UNIX or even Windows literate. He is a BOSS, not a> Except that John's boss is on the list too!
>
GRUNT. He may, from years past, remember some COBOL (remember that?). If I
told him that I was on a Perl list, he would think that I was talking
about the things that come out of oysters.
--
Maranatha!
John McKown
John McKown Guest
-
Larry Snider #13
Re: [meta] Please delete boilerplate! (was Re: Covert Date to week number)
"John McKown" <joarmc@swbell.net> wrote in message
news:Pine.LNX.4.44.0401231951460.14064-100000@mckown4.johnmckown.net...
> > Except that John's boss is on the list too!
I don't know about John's boss but I'm not even on "the list." I'm reading
this in a newsgroup via GigaNews.
--
[url]www.eSnider.net[/url]
Larry Snider Guest



Reply With Quote

