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

DateTime formatting

How to format a DateTime to appear like this :

Sat, 19 Feb 2005 00:00:00 GMT
Apr 12 '06 #1
5 1749
Here is one way. Please always first check your help for this kind of
thing:

ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxfund/html/98b374e3-0cc2-4c78-ab44-efb671d71984.htmstring df = @"ddd, dd MMM yyyy hh:mm:ss G\MT";Console.WriteLine(df +": " + DateTime.Now.ToString(df));--William Stacey [MVP]"John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in messagenews:u5**************@TK2MSFTNGP03.phx.gbl. ..| How to format a DateTime to appear like this :|| Sat, 19 Feb 2005 00:00:00 GMT||

Apr 13 '06 #2
On Wed, 12 Apr 2006 15:52:27 -0700, "John A Grandy"
<johnagrandy-at-yahoo-dot-com> wrote:
How to format a DateTime to appear like this :

Sat, 19 Feb 2005 00:00:00 GMT


string stringDate = string.Format("{0:ddd, dd MMM yyyy HH:mm:ss }GMT",
DateTime.UtcNow);
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
Apr 13 '06 #3
yah. I forgot to mention. Make sure your DateTime is already converted to
UTC.

--
William Stacey [MVP]

"William Stacey [MVP]" <wi************@gmail.com> wrote in message
news:u5**************@TK2MSFTNGP02.phx.gbl...
| Here is one way. Please always first check your help for this kind of
| thing:
|
|
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxfund/html/98b374e3-0cc2-4c78-ab44-efb671d71984.htmstring
df = @"ddd, dd MMM yyyy hh:mm:ss G\MT";Console.WriteLine(df +": " +
DateTime.Now.ToString(df));--William Stacey [MVP]"John A Grandy"
<johnagrandy-at-yahoo-dot-com> wrote in
messagenews:u5**************@TK2MSFTNGP03.phx.gbl. ..| How to format a
DateTime to appear like this :|| Sat, 19 Feb 2005 00:00:00 GMT||
|
Apr 13 '06 #4
Way way easier ...

string stringDateTime = DateTime.Now.ToString("r");
"Otis Mukinfus" <ph***@emailaddress.com> wrote in message
news:8j********************************@4ax.com...
On Wed, 12 Apr 2006 15:52:27 -0700, "John A Grandy"
<johnagrandy-at-yahoo-dot-com> wrote:
How to format a DateTime to appear like this :

Sat, 19 Feb 2005 00:00:00 GMT


string stringDate = string.Format("{0:ddd, dd MMM yyyy HH:mm:ss }GMT",
DateTime.UtcNow);
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com

Apr 14 '06 #5
On Fri, 14 Apr 2006 12:48:06 -0700, "John A Grandy"
<johnagrandy-at-yahoo-dot-com> wrote:
Way way easier ...

string stringDateTime = DateTime.Now.ToString("r");
"Otis Mukinfus" <ph***@emailaddress.com> wrote in message
news:8j********************************@4ax.com.. .
On Wed, 12 Apr 2006 15:52:27 -0700, "John A Grandy"
<johnagrandy-at-yahoo-dot-com> wrote:
How to format a DateTime to appear like this :

Sat, 19 Feb 2005 00:00:00 GMT


string stringDate = string.Format("{0:ddd, dd MMM yyyy HH:mm:ss }GMT",
DateTime.UtcNow);
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com

Thanks, John.

You're right!

Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
Apr 14 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ed | last post by:
Hi there, My problem is the following: When I assign a custom formatted Date & Time to a Date variable it loses it’s formatting. Ex. 2005-06-07 15:46 now when I assign this to a variable of...
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" ...
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'...
13
by: Alan M Dunsmuir | last post by:
I need to specify a new data type, almost entirely a 'clone' of the existing DateTime type, with the following specific difference, and all the consequent differences in properties and methods...
2
by: Rob Roberts | last post by:
I have a GridView that is bound to a collection of DateTimes (i.e. - Collection<DateTime>). I have a BoundField in the GridView, and its DataField is set to the DateTime's Date property, and the...
0
by: H5N1 | last post by:
Hi there I know that a problem of different datetime strings formatting between asp.net and ms sql has been covered here widely, but what I couldn't find is the 100% safe way of getting datetime...
5
by: cpnet | last post by:
I'm able to pass string parameters with no problems to a LocalReport being displayed by the ASP.NET ReportViewer control. However, my report also has a DateTime parameter. ...
1
by: Untitled | last post by:
I have an application that stores all DateTime inforamtion in UTC. However, this application will be accessed from arround the world. I would like my users to be able to specify their prefered...
3
by: Tim | last post by:
Folks, I'm trying to format a print string so that it reports progress whilst processing a looping structure with a date time stamp appended to the end of the string. This started out life as a...
0
yasirmturk
by: yasirmturk | last post by:
Standard Date and Time Functions The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.