Results 1 to 3 of 3

Thread: [2008] Manupilating Date

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Posts
    167

    [2008] Manupilating Date

    Lets say I have the date "Monday January 1"
    can I do something like

    Dim x as date
    x = Monday January 1 + 8 days ==> Monday
    x = Monday January 1 + 1 Month ==> it must return the name of the day(monday,tuesday...)
    x = Monday January 1 + 1 Year ==> it must return the name of the day(monday,tuesday...)

    is there any class that already does this? if no, how can i do it?
    Im using Visual Studio 2008 Professional Edition
    .Net Framework 3.5

  2. #2
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: [2008] Manupilating Date

    Yes. Something like this:

    vb.net Code:
    1. Dim _Date As DateTime = DateTime.Parse("2008-04-09")
    2. Dim _Day As String = String.Empty
    3.  
    4. 'For Day
    5. _Day = _Date.AddDays(7).DayOfWeek.ToString()
    6. 'For Month
    7. _Day = _Date.AddMonths(1).DayOfWeek.ToString()
    8. 'For Year
    9. _Day = _Date.AddYears(1).DayOfWeek.ToString()

  3. #3
    Lively Member
    Join Date
    Dec 2007
    Posts
    66

    Re: [2008] Manupilating Date

    just select the date in a datetimepicker...

    make sure the datetimepicker has the format set to long...

    then use code like:

    datetimepicker.value.day

    that gives you the day value.....

    is that what you mean?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width