RE: [U2] oconv to get week of the year

2007-02-17 Thread Boydell, Stuart
Nb. The program is http://www.pickwiki.com/cgi-bin/wiki.pl?DateUtility
which you can call with the method "GetISOWeekOfYear"
Cheers, Stuart

>-Original Message-
>>Does anyone know of a oconv function to get the week no of year for a
date
>>value. Simlair to DWA but instead of the week day, i want the week no
>>
>Go to Pickwiki. One of the programs there does a whole variety of date
>conversions, and one of them is for the ISO week number. You can adapt
>that as necessary.
>
>Cheers,
>Wol


 
**
This email message and any files transmitted with it are confidential and 
intended solely for the use of addressed recipient(s). If you have received 
this communication in error, please reply to this e-mail to notify the sender 
of its incorrect delivery and then delete it and your reply.  It is your 
responsibility to check this email and any attachments for viruses and defects 
before opening or sending them on. Spotless collects information about you to 
provide and market our services. For information about use, disclosure and 
access, see our privacy policy at http://www.spotless.com.au 
Please consider our environment before printing this email. 
** 
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] oconv to get week of the year

2007-02-17 Thread Anthony W. Youngman
In message <[EMAIL PROTECTED]>, Mac 
Bhyat <[EMAIL PROTECTED]> writes

Hi,

Does anyone know of a oconv function to get the week no of year for a date
value. Simlair to DWA but instead of the week day, i want the week no

Go to Pickwiki. One of the programs there does a whole variety of date 
conversions, and one of them is for the ISO week number. You can adapt 
that as necessary.


Cheers,
Wol
--
Anthony W. Youngman <[EMAIL PROTECTED]>
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site -  Open Source Pick
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] oconv to get week of the year

2007-02-16 Thread Stevenson, Charles
> From: Martin Phillips
> 
> The algorithm for ISO week numbers (which seems like a widely 
> used standard) can be found at 
> http://personal.ecu.edu/mccartyr/ISOwdALG.txt


I don't think I've ever given this even a moment's thought.

HPUX `man date` says it recognizes:

  %U   Week number of the year (Sunday as the first day of the
   week) as a two-digit decimal number [00-53].  All days that
   precede the first Sunday in the year are considered to be in
   week 00. 
  %V   Week number of the year (Monday as the first day of the
   week) as a two-digit decimal number [01-53].  If the week
   containing January 1 has four or more days in the new year
   (January 1 is Thursday or sooner), it is designated as week
   01; otherwise, (January 1 is Friday or later), it is
   designated as the last week of the previous year, and the
   next week is week 01.
  %W   Week number of the year (Monday as the first day of the
   week) as a two-digit decimal number [00-53].  All days that
   precede the first Monday in the year are considered to be in
   week 00.

Looks like %V matches up with ISO, per MP's url:

  ISO 8601 specifies that Week 01 of the year is the week containing
  the first Thursday; Monday is Weekday 1, Sunday is Weekday 7;
  WeekNumber requires two digits (W01, W02, etc.; "W" is optional)


Now I've given it a moment's thought.
cds
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] oconv to get week of the year [ad:too]

2007-02-16 Thread Lee Bacall /Moley 888
Mac
Here's a way to calculate the week of the year

 SetWeekNo:
 FirstDate = "01/01/":fld$YEAR  ;! with fld$YEAR being in the form 
 ExtraWeek = ICONV(FirstDate,"DQ") GE 4
 iydate = ICONV(FirstDate,"D4/")  ;! Internal date, year's starting date
 Dw = OCONV(iydate,"DW")
 *-- setup
 MonthDate=fld$MONTH.NO:"/01/":fld$YEAR
 idate = ICONV(MonthDate,"D4/")
 Julian = OCONV(idate,"DJ");! first julian day of selected month

 adj.julian=Julian+Dw -1
 weekno = INT(adj.julian/7)+ExtraWeek
*to plug the week numbers into a calendar
 FOR week = 0 TO 5
   fld$WEEK.NBR<1,(week+1)>=weekno+week
 NEXT week

This routine is from the Nucleus calendar, which is part of the Nucleus
environment.

Our dealer in South Africa is,
http://www.binarystar.co.za

Lee Bacall
binarystar.com

- Original Message - 
From: "Mac Bhyat" <[EMAIL PROTECTED]>
To: 
Sent: Friday, February 16, 2007 9:25 AM
Subject: [U2] oconv to get week of the year


> Hi,
>
> Does anyone know of a oconv function to get the week no of year for a date
> value. Simlair to DWA but instead of the week day, i want the week no
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] oconv to get week of the year

2007-02-16 Thread Martin Phillips
The algorithm for ISO week numbers (which seems like a widely used standard) 
can be found at http://personal.ecu.edu/mccartyr/ISOwdALG.txt



Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB
+44-(0)1604-709200 
---

u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] oconv to get week of the year

2007-02-16 Thread Gordon J Glorfield
Mac,

Sorry but there is no conversion to give you the week number.  There are 
several ways to get what you seek.  However there are also several issues 
that need to be considered in coming up with your own function.  First and 
foremost is the question; what is the first week of the year?  Is it the 
partial week that includes January 1 or is it the first full week?  What 
constitutes a full week?  Does a week start on Monday or Sunday?  This has 
been discussed on this list many times.

HTH,
Gordon


Gordon J. Glorfield
Sr. Applications Developer
UnitedHealthcare's Mid-Atlantic Health Plans
301-360-8839

[EMAIL PROTECTED] wrote on 02/16/2007 09:25:14 AM:

> Hi,

> Does anyone know of a oconv function to get the week no of year for a 
date
> value. Simlair to DWA but instead of the week day, i want the week no

> thanks

> mac
> --
> This message was scanned for spam and viruses by BitDefender.
> For more information please visit http://linux.bitdefender.com/
> ---
> u2-users mailing list
> u2-users@listserver.u2ug.org
> To unsubscribe please visit http://listserver.u2ug.org/


This e-mail, including attachments, may include confidential and/or 
proprietary information, and may be used only by the person or entity to 
which it is addressed. If the reader of this e-mail is not the intended 
recipient or his or her authorized agent, the reader is hereby notified 
that any dissemination, distribution or copying of this e-mail is 
prohibited. If you have received this e-mail in error, please notify the 
sender by replying to this message and delete this e-mail immediately.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] oconv to get week of the year

2007-02-16 Thread Kevin King
The topic of week number has been discussed quite a bit on this list.
Unfortunately, it's not a simple matter.  What day of the week does
the week number start on?  If January 1st is a Sunday, what week
number does January 7th fall on?  Or what if the 1st is a Saturday,
does that change the week number of the 7th?  And what about 53 week
years?

The calculation of week number has a number of variables based on how
you intend to use it.  There is no "stock" calculation, though you
could certainly make one up with the Julian date conversion (DJ)
divided by 7.  But I doubt that'd give you much to work with. 

-Kevin
[EMAIL PROTECTED]
http://www.PrecisOnline.com
 
** Check out scheduled Connect! training courses at
http://www.PrecisOnline.com/train.html.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/