473,382 Members | 1,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Day Name

Hi,

Can anyone tell me an easy way to get the name of the day if I supply a
date? For example if I enter the 1/July/2004 I want it to return a
Thrusday. I know there is a function (I think) but I've looked everywhere
and can't find it.

Thanks
Richard
Nov 20 '05 #1
5 10877
* "Richard" <ri*****@home.com> scripsit:
Can anyone tell me an easy way to get the name of the day if I supply a
date? For example if I enter the 1/July/2004 I want it to return a
Thrusday. I know there is a function (I think) but I've looked everywhere
and can't find it.


\\\
MsgBox(DateTime.Now.ToString("dddd"))
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
DateTime.DayOfWeek?? This will not return Thursday, but rather a enum value for the Day of Week.

--
Regards,
Anand M
VB.NET MVP

http://www.dotnetindia.com
"Richard" wrote:
Hi,

Can anyone tell me an easy way to get the name of the day if I supply a
date? For example if I enter the 1/July/2004 I want it to return a
Thrusday. I know there is a function (I think) but I've looked everywhere
and can't find it.

Thanks
Richard

Nov 20 '05 #3
And of course you can then pass that enum value to the DateTimeFormatInfo.GetDayName function to get a culture specific description of the Day of week.

--
Regards,
Anand M
VB.NET MVP

http://www.dotnetindia.com
"Anand[MVP}" wrote:
DateTime.DayOfWeek?? This will not return Thursday, but rather a enum value for the Day of Week.

--
Regards,
Anand M
VB.NET MVP

http://www.dotnetindia.com
"Richard" wrote:
Hi,

Can anyone tell me an easy way to get the name of the day if I supply a
date? For example if I enter the 1/July/2004 I want it to return a
Thrusday. I know there is a function (I think) but I've looked everywhere
and can't find it.

Thanks
Richard

Nov 20 '05 #4
Hi Richard,

You can try it this will work for you

MessageBox.Show(CDate("1/July/2004").DayOfWeek.ToString)

However it returns Thursday not Thrusday.

I hope this helps?

Cor

Can anyone tell me an easy way to get the name of the day if I supply a
date? For example if I enter the 1/July/2004 I want it to return a
Thrusday. I know there is a function (I think) but I've looked everywhere
and can't find it.

Thanks
Richard

Nov 20 '05 #5
Addendum:
Can anyone tell me an easy way to get the name of the day if I supply a
date? For example if I enter the 1/July/2004 I want it to return a
Thrusday. I know there is a function (I think) but I've looked everywhere
and can't find it.


\\\
MsgBox(DateTime.Now.ToString("dddd"))
///


- or -

'WeekdayName'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: stewart.midwinter | last post by:
No doubt I've overlooked something obvious, but here goes: Let's say I assign a value to a var, e.g.: myPlace = 'right here' myTime = 'right now' Now let's say I want to print out the two...
2
by: Ravi | last post by:
My XML looks like: <abc> <def type="apple"> 1 </def> <def type="peach"> 2 </def> <def type="orange"> 3 </def> <def type="banana"> 4 </def> <def type="plum"> 5 </def> </abc>
1
by: discomiller | last post by:
Mario Mueller: Hello *, radiobuttons belong to other radiobuttons by the "name="any_value"" attribut. Thats a fakt. I got the following XML:...
21
by: TheKeith | last post by:
I heard that the name attribute is deprecated in html 4.01 strict. Is it recommended that you use the ID attribute for images along with the getElementById method instead of the old way? Thanks.
1
by: Prasad Karunakaran | last post by:
I am using the C# DirectoryEntry class to retrieve the Properties of an user object in the Active Directory. I need to get the First Name and Last Name as properties. I know it is not supported...
13
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
3
by: jparulan | last post by:
Hi All, I'm using SOAP3.0. I was able to successfully call a WSDL file and get a value properly. But when the WSDL changed to have a MULTIPLE <element name> it was failing. This code works...
1
by: ivanet | last post by:
Hello everyone, I am trying to use the following Schema but I get the error "src- resolve: Cannot resolve the name 'ValuesList' to a(n) 'element declaration' component." at line 144. I have...
2
by: pythonnewb | last post by:
I am fairly new to programming but have some very basic Java background. I am just learning python and tried to make a module that would allow me to create a file containing an address book. I was...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.