471,310 Members | 1,362 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

DateTime Format

Experts,

How can I format 8/1/2008 into Aug-1-2008?

Thank you very much.
Aug 13 '08 #1
6 1873
John wrote:
How can I format 8/1/2008 into Aug-1-2008?
http://msdn.microsoft.com/library/8kb3ddd4
--
J.
Aug 13 '08 #2
On Aug 13, 12:42*pm, John <J...@discussions.microsoft.comwrote:
Experts,

How can I format 8/1/2008 into Aug-1-2008?

Thank you very much.

C#

DateTime.Parse("8/1/2008").ToString("MMM - dd- yyy");
Aug 13 '08 #3
On Aug 13, 2:13*pm, Netmonster <netmonster...@yahoo.comwrote:
On Aug 13, 12:42*pm, John <J...@discussions.microsoft.comwrote:
Experts,
How can I format 8/1/2008 into Aug-1-2008?
Thank you very much.

C#

DateTime.Parse("8/1/2008").ToString("MMM - dd- yyy");
sry forgot to complete the year.

DateTime.Parse("8/1/2008").ToString("MMM-dd-yyyy");
Aug 13 '08 #4
Thank you so much.

"Netmonster" wrote:
On Aug 13, 2:13 pm, Netmonster <netmonster...@yahoo.comwrote:
On Aug 13, 12:42 pm, John <J...@discussions.microsoft.comwrote:
Experts,
How can I format 8/1/2008 into Aug-1-2008?
Thank you very much.
C#

DateTime.Parse("8/1/2008").ToString("MMM - dd- yyy");

sry forgot to complete the year.

DateTime.Parse("8/1/2008").ToString("MMM-dd-yyyy");
Aug 13 '08 #5
Netmonster wrote:
On Aug 13, 2:13 pm, Netmonster <netmonster...@yahoo.comwrote:
>On Aug 13, 12:42 pm, John <J...@discussions.microsoft.comwrote:
>>Experts,
How can I format 8/1/2008 into Aug-1-2008?
Thank you very much.
C#

DateTime.Parse("8/1/2008").ToString("MMM - dd- yyy");

sry forgot to complete the year.

DateTime.Parse("8/1/2008").ToString("MMM-dd-yyyy");
That code depends on the setup of Windows.

On my PC it returns Jan-8-2008 !

Use:

DateTime.ParseExact(s, "M/d/yyyy",
CultureInfo.InvariantCulture).ToString("MMM-dd-yyyy")

to enforce the correct interpretation of the input.

Arne
Aug 14 '08 #6
[Date type].toString("ddd-MM-yyyy", new CultureInfo("EN-US")), just describe
the syntax.

"John" <Jo**@discussions.microsoft.comwrote in message
news:D1**********************************@microsof t.com...
Experts,

How can I format 8/1/2008 into Aug-1-2008?

Thank you very much.
Aug 15 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by Fritz Switzer | last post: by
38 posts views Thread by nobody | last post: by
26 posts views Thread by Reny J Joseph Thuthikattu | last post: by
11 posts views Thread by Cor Ligthert | last post: by
4 posts views Thread by Arpan | last post: by
5 posts views Thread by js | last post: by
reply views Thread by rosydwin | last post: by

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.