473,405 Members | 2,344 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,405 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 1481
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.