Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I know which day is today? 1

Status
Not open for further replies.

tg2003

IS-IT--Management
Feb 6, 2003
270
IL
I'm looking for a built-in function that tells me what day is today. I mean to its name - Sunday, Monday and so forth.

I'm using VB.NET 2008

Is there anything?
Or should I use some function that can calculate it by the full date?

Thanks in advance!
 
Try:

DateTime.Today.ToString("dddd")

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB.NET Programmer
 
Thank you!

Just to understand it: Why 4 times 'd' letter? What does it mean?
 
If you look at the Help file for date formats, you will see something like:

d = day number (2, 5, 17)
dd = day number with preceeding 0 (02, 05, 17)
ddd = day name abreviated (Tue, Thu, Sat)
dddd = full day name (Tuesday, Thursday, Saturday)

Hope that helps.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB.NET Programmer
 
Alternatively you can
Code:
Date.Today.DayOfWeek.ToString
that will be equal to
Code:
DateTime.Today.ToString("dddd")

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Thanks ZmrAbdulla...I missed that one. Star to you.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB.NET Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top