What's the .NET code that replaces the VB6 one of WeekDay?
I have tried Date., but there is nothing in the intellisence.
woka
Printable View
What's the .NET code that replaces the VB6 one of WeekDay?
I have tried Date., but there is nothing in the intellisence.
woka
That code sets the variable dateToday to hold the date and time now and then outputs the Day of the week.Code:DateTime dateToday = DateTime.Now;
Response.Write(dateToday.DayOfWeek);
Does that help?
DJ
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
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
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 :D woohooo.
Cheers for the help.
Woof