Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6078505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:50:29+00:00 2026-05-23T10:50:29+00:00

I am developing an ASPX VB.NET file. My assignment is to convert an integer

  • 0

I am developing an ASPX VB.NET file. My assignment is to convert an integer representing week of the year into that end date. For example, if user selects Week 4 for 2011, I want to get date = 1/22/11. How do I do this in VB.NET?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:50:29+00:00Added an answer on May 23, 2026 at 10:50 am

    I’ve asked a similar question a short while ago. I also have an answer from J.Skeet for a RegularExpressionValidator(if you need one).

    Here is what i have to get a date from a week of year:

    Public Shared Function FirstDateOfWeek(ByVal year As Integer, ByVal weekOfYear As Integer) As DateTime
          Dim jan1 As New DateTime(year, 1, 1)
          Dim daysOffset As Integer = CInt(Globalization.CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek) - CInt(jan1.DayOfWeek)
          Dim firstWeekDay As DateTime = jan1.AddDays(daysOffset)
          Dim curCulture As System.Globalization.CultureInfo = System.Globalization.CultureInfo.CurrentCulture
          Dim firstWeek As Integer = curCulture.Calendar.GetWeekOfYear(jan1, curCulture.DateTimeFormat.CalendarWeekRule, curCulture.DateTimeFormat.FirstDayOfWeek)
          If firstWeek <= 1 Then
              weekOfYear -= 1
          End If
          Return firstWeekDay.AddDays(weekOfYear * 7)
    End Function
    

    and here is the RegularExpressionValidator, although my format(07w42 means 42.week in year 2007) differs a little from yours.

    <asp:RegularExpressionValidator ID="CalWeekFormat" runat="server" 
                                     ControlToValidate="TxtCalWeek" Display="None" EnableClientScript="true" 
                                     ErrorMessage="Enter valid Year/Calendarweek-Format: examplary format '09w23' or '9w23' for year 2009 and week 23" 
                                     style="visibility:hidden" 
                                     ValidationExpression="^\d{1,4}[wW](\d|[0-4]\d|5[0123])$" 
                                     ValidationGroup="VG_SAVE">*</asp:RegularExpressionValidator>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a VB.NET ASPX file and am trying to run a string
We are developing an ASPX (.NET 2.0) page that includes a select list with
I am developing a VB.NET ASPX file in VS 2008. I am having trouble
I am developing a VB.NET ASPX file which is currently working. But now it
I'm developing a newsletter in asp.net that will be send to a large quantity
I am developing an ASP.NET MVC app and I've been looking into using Data
I'm developing .net application using wmi and win32_* WQL queries. http://msdn.microsoft.com/en-us/library/aa394084(VS.85).aspx Will such application
I'm developing some CRUD screens for retrieving/updating various items using .NET 3.5 and aspx
we are developing into an asp classic application introducing new asp.net pages. The session
I'm developing a C# .net application that allows users to insert text and have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.