Format DateTime to string with no seconds
-
I want to format a DateTime value into a string. The thing is that I’m developing a Multilanguage application and I want to format the string according to the users culture. For example: Swedish: YYYY:MM:DD HH:mm English: DD/MM/YYYY HH:mm
_____________________________ ...and justice for all
-
I want to format a DateTime value into a string. The thing is that I’m developing a Multilanguage application and I want to format the string according to the users culture. For example: Swedish: YYYY:MM:DD HH:mm English: DD/MM/YYYY HH:mm
_____________________________ ...and justice for all
I believe there's a ToString method that uses the local culture, or that takes the culture at least, so you can ask the system for it ).
Christian Graus Driven to the arms of OSX by Vista.
-
I want to format a DateTime value into a string. The thing is that I’m developing a Multilanguage application and I want to format the string according to the users culture. For example: Swedish: YYYY:MM:DD HH:mm English: DD/MM/YYYY HH:mm
_____________________________ ...and justice for all
If you are creating a multi-language application you should use the ToShortDateString, etc methods which are based on the current culture settings of the application. http://msdn.microsoft.com/en-us/library/system.datetime.toshortdatestring.aspx[^]
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego. -
I want to format a DateTime value into a string. The thing is that I’m developing a Multilanguage application and I want to format the string according to the users culture. For example: Swedish: YYYY:MM:DD HH:mm English: DD/MM/YYYY HH:mm
_____________________________ ...and justice for all
string myDate = DateTime.Now.ToString("dd/MM/YYYY HH:mm");
Why was this post voted a 1?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001modified on Wednesday, January 21, 2009 1:35 PM
-
I want to format a DateTime value into a string. The thing is that I’m developing a Multilanguage application and I want to format the string according to the users culture. For example: Swedish: YYYY:MM:DD HH:mm English: DD/MM/YYYY HH:mm
_____________________________ ...and justice for all
Yeah, what they said, but you should only use ISO 8601-compliant date formats: yyyy-MM-dd HH:mm
-
I believe there's a ToString method that uses the local culture, or that takes the culture at least, so you can ask the system for it ).
Christian Graus Driven to the arms of OSX by Vista.
DateTime.ToString("g") made it for me.
_____________________________ ...and justice for all