How about:

DateTime dt = DateTime.Now;
string s = dt.ToString("MMddyyhhss");

Take a look at the date and time format string section[1] in the doc.

Seang

[1]
ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpcondatetimeformatstrings.htm

-----Original Message-----
From: Nischal Muthana [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 1:12 PM
To: [EMAIL PROTECTED]
Subject: [DOTNET] DateTime Format


Hi All

Can someone help me with an example of getting the
current date and time into a
string format like "mmddyyhhss" -- "061802131235"

Appreciate any help.

Thanks
Nischal

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to