472,960 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,960 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 1918
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Fritz Switzer | last post by:
I'd like to have a string assigned the value of a DateTime.AddMinutes(amount) so that the string is formatted in "HH:MM" format. For example: DateTime.Now.AddMinutes(30) returns "00:30" ...
38
by: nobody | last post by:
I know that given a FormatString and a DateTime you can use DateTime.ToString(...) to convert the DateTime to a String. My question is how can you turn that around? Given a String and a...
26
by: Reny J Joseph Thuthikattu | last post by:
Hi, I have a variabe in the format of 'DD-MON-YYYY HH:MI AM' .I want to add a miniute to it.How can i do that? by manipulation i want to make '01-JUNE-2004 11:59 PM' to '02-JUNE-2004 12:00 AM'...
11
by: Cor Ligthert | last post by:
Hello everybody, Jay and Herfried are telling me every time when I use CDate that using the datetime.parseexact is always the best way to do String to datetime conversions. They don't tell why...
4
by: Arpan | last post by:
A SQL Server 2005 DB table has 4 columns namely "ID" (IDENTITY int column), "FirstName" (varchar(50)), "LastName" (varchar(50)) & "DOB" (datetime). Now when I am trying to add a new row using the...
5
by: js | last post by:
I have a textbox contains text in the format of "yyyy/MM/dd hh:mm:ss". I need to parse the text using System.DateTime.Parse() function with custom format. I got an error using the following code. ...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.