By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,682 Members | 1,987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,682 IT Pros & Developers. It's quick & easy.

date formatting

P: n/a
How can I format a string so that only the months name (and nothing else) is
displayed?

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
Jul 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Single string or binding a DataSet to a control?

For a single string, one idea is putting the string into a DateTime object
and extracting the month. A bit weighty to simply pull a month, but it can be
extremely useful if you ever need any other parts of the data.

If you are binding multiple pieces of data, you can use the String.Format()
static method to format strings however you desire. This can also be used on
a single string, so it is quite flexible.

Here is some info:
http://idunno.org/displayBlog.aspx/2004071401
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"cody" wrote:
How can I format a string so that only the months name (and nothing else) is
displayed?

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk

Jul 21 '05 #2

P: n/a
System.DateTime has a very handy override of ToString() allowing you to show
whatever you want.

System.DateTime mydate = new System.DateTime.Today.

Response.Write(mydate.ToString("MMMM d yyyy")); // December 20, 2004
Response.Write(mydate.ToString("MMMM")); // December

etc. check it out on MSDN, you'll find more examples there.

--
Ben Strackany
www.developmentnow.com
"cody" <no****************@gmx.net> wrote in message
news:ev**************@TK2MSFTNGP15.phx.gbl...
How can I format a string so that only the months name (and nothing else) is displayed?

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk

Jul 21 '05 #3

P: n/a
Thanks that was I was looking for.

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"Ben Strackany" <in********@developmentnow.nospam.com> schrieb im
Newsbeitrag news:OL**************@TK2MSFTNGP09.phx.gbl...
System.DateTime has a very handy override of ToString() allowing you to show whatever you want.

System.DateTime mydate = new System.DateTime.Today.

Response.Write(mydate.ToString("MMMM d yyyy")); // December 20, 2004
Response.Write(mydate.ToString("MMMM")); // December

etc. check it out on MSDN, you'll find more examples there.

--
Ben Strackany
www.developmentnow.com
"cody" <no****************@gmx.net> wrote in message
news:ev**************@TK2MSFTNGP15.phx.gbl...
How can I format a string so that only the months name (and nothing
else) is
displayed?

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk


Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.