Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Week of year to full Year

Reply
Thread Tools

Week of year to full Year

 
 
Otuatail
Guest
Posts: n/a
 
      12-08-2003
Can anyone tell me if this is possible.
I have populated a drop down list bor with all the saturdays over a short
period
of time like this.
<SELECT Name="SelectedWeek">
<Option Value="49">06 December 2003</Option>
<Option Value="50">13 December 2003</Option>

When I submit the page I can retreve the Value 49 or 50 etc.

I need to either retreve the full date i.e. 06 December 2003 or
A function that can turn the value back from 49 to the full date.

Is there a way around this problem please.


Paul.

 
Reply With Quote
 
 
 
 
William Tasso
Guest
Posts: n/a
 
      12-08-2003
Otuatail wrote:
> Can anyone tell me if this is possible.
> I have populated a drop down list bor with all the saturdays over a
> short period
> of time like this.
> <SELECT Name="SelectedWeek">
> <Option Value="49">06 December 2003</Option>
> <Option Value="50">13 December 2003</Option>
>
> When I submit the page I can retreve the Value 49 or 50 etc.
>
> I need to either retreve the full date i.e. 06 December 2003 or
> A function that can turn the value back from 49 to the full date.
>
> Is there a way around this problem please.


<option value="06 December 2003">06 December 2003</option>

--
William Tasso - http://WilliamTasso.com


 
Reply With Quote
 
 
 
 
Toby A Inkster
Guest
Posts: n/a
 
      12-08-2003
Otuatail wrote:

> A function that can turn the value back from 49 to the full date.


What William said is probably what you want, but if you do need to turn
back 49 into the date, which server-side scripting language are you using?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

 
Reply With Quote
 
Otuatail
Guest
Posts: n/a
 
      12-08-2003
I am using VB Script. The only one
that I know I am A vb Programmer.

Paul.

 
Reply With Quote
 
Toby A Inkster
Guest
Posts: n/a
 
      12-08-2003
Otuatail wrote:

> I am using VB Script. The only one
> that I know I am A vb Programmer.


Say you want to find out the beginning of week 49.

Step 0. n is 49.

n = 49

Step 1. Take the beginning of the year.

y = Format(Now(), "yyyy")
beginningOfYearString = "1/1/" & y & "00:00:00"

Step 2. Turn this from a String into a Date.

beginningOfYearDate = CDate(beginningOfYearString)

Step 3. Add on 49 Weeks. Depending on what you count as "week 1",
you may want to change 'n' to 'n+1' or 'n-1' or something.

wantedDate = beginningOfYearDate.AddDays(7 * (n))

Step 4. Go forward to the Saturday.

While Weekday(wantedDate)
wantedDate.AddDays(1)
Wend

I think that should do what you want, but my VisualBASIC is a little rusty.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
the penultimate week and last week of data for each month SimonC Javascript 13 01-04-2005 10:20 PM
OT: I'm full of fun this week Ken Briscoe MCSE 2 11-17-2004 10:08 PM
ASP.NET: Day / Work Week / Week / Month web calendar control with view like MS Outlook ASP .Net Web Controls 3 12-22-2003 10:42 PM
ASP.NET: Day / Work Week / Week / Month web calendar control with view like MS Outlook ASP .Net 3 12-22-2003 10:42 PM
ASP.NET: Day / Work Week / Week / Month web calendar control with view like MS Outlook ASP .Net Building Controls 3 12-22-2003 10:42 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57