Results 1 to 5 of 5

Thread: VB = WeekDay(dteMyDate), .NET = ???

  1. #1

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    VB = WeekDay(dteMyDate), .NET = ???

    What's the .NET code that replaces the VB6 one of WeekDay?
    I have tried Date., but there is nothing in the intellisence.

    woka

  2. #2
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    Re: VB = WeekDay(dteMyDate), .NET = ???

    Code:
    DateTime dateToday = DateTime.Now;
    
    Response.Write(dateToday.DayOfWeek);
    That code sets the variable dateToday to hold the date and time now and then outputs the Day of the week.

    Does that help?

    DJ

    If I have been helpful please rate my post. If I haven't tell me!

  3. #3

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: VB = WeekDay(dteMyDate), .NET = ???

    Yup just found it DOH!
    Cheers.

    Trying to work out how to add dates now...I have done it before. It's 32 deg c in our office today and this heats playing with my head

    Woka

  4. #4
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    Re: VB = WeekDay(dteMyDate), .NET = ???

    There are several methods in DateTime to add dates: AddDay, AddHours, AddMilliseconds, AddMinutes, AddMonths, AddSeconds, AddYears...

    I think the best way of doing it is convert your DateTime variable to Ticks using the Ticks property and then feed this into the AddTicks method. It's bizarre to me why they just didn't have an AddDateTime method!

    32 degrees here too - I'm sure its illegal - I'm going to walk out and lie in the sun!

    DJ

    If I have been helpful please rate my post. If I haven't tell me!

  5. #5

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: VB = WeekDay(dteMyDate), .NET = ???

    Yea, I found the ticks method, but wasn't sure about it

    13 degrees is the legal lower limit for an office, but as far as UK legislation goes, there is no legal upper limit. the World Health Organisation recommends a top temperature of 24 degrees c for an office, but you cannot enforce this. Stupid offices in Leeds

    We have been told if it's too hot then we can go home woohooo.

    Cheers for the help.

    Woof

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