473,379 Members | 1,423 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,379 software developers and data experts.

date formatting

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
3 1477
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Rob T | last post by:
I'm storing a date/time into a SQL table of type datetime. I need it to be precise so the value is stored to the 1000th of a second. ie "insert into myTable mydate values ('08/05/2005...
11
by: Rob T | last post by:
I'm storing a date/time into a SQL table of type datetime. I need it to be precise so the value is stored to the 1000th of a second. ie "insert into myTable mydate values ('08/05/2005...
2
by: johndcal | last post by:
Hello All, I have a date value that I pull from a .csv file. After reading the file and storing the values in an array the value of the date could be found in $array, for example....
2
by: David Veeneman | last post by:
How does one format a date column in a GridView control? I had assumed that the DataFormat string would do it, but MSDN only shows numeric formatting codes. Can dates be formatted using that...
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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.