473,406 Members | 2,867 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,406 software developers and data experts.

Regional settings made at the operating system level

Hi All

regional settings made at the operating system level. For example, Canada
uses a dd/mm/yyyy format while the US uses mm/dd/yyyy.

how can i get this type date format :
iam using this code in C#:
System.DateTime.UtcNow.Date.ToString();

Regards
Venu.
Nov 16 '05 #1
2 6783
Karunakararao <ka************@i-vantage.com> wrote:
regional settings made at the operating system level. For example, Canada
uses a dd/mm/yyyy format while the US uses mm/dd/yyyy.

how can i get this type date format :
iam using this code in C#:
System.DateTime.UtcNow.Date.ToString();


DateTime.UtcNow.ToString("dd/MM/yyyy");
or
DateTime.UtcNow.ToString("MM/dd/yyyy");

See "custom date and time format strings" in MSDN for more information.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Venu,

What you can do is use the static CurrentCulture or CurrentUICulture
properties on the Thread class to get the current culture for the thread.
That will return a CultureInfo instance which you can then get the
DateTimeFormat property of to get the datetime format that is set for the
system.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Karunakararao" <ka************@i-vantage.com> wrote in message
news:e1**************@TK2MSFTNGP12.phx.gbl...
Hi All

regional settings made at the operating system level. For example, Canada
uses a dd/mm/yyyy format while the US uses mm/dd/yyyy.

how can i get this type date format :
iam using this code in C#:
System.DateTime.UtcNow.Date.ToString();

Regards
Venu.

Nov 16 '05 #3

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

Similar topics

4
by: Grumfish | last post by:
Is there a way to tell Java what localization to use so applications and the compiler doesn't default to the system's setting? I'm using a computer with Windows 2000 with a regional setting of...
4
by: Jonathan | last post by:
Dear All, I am trying to set a webserver to use French regional settings for testing ASP pages. According to http://support.microsoft.com/kb/q306044, for IIS5, this is a matter of changing...
3
by: Karunakararao | last post by:
Hi All, How can i get the date based on Regional settings . how can i get the date format using C# .NET " The date displayed in the date/time field should be formatted according to the...
1
by: Karunakararao | last post by:
Hi All regional settings made at the operating system level. For example, Canada uses a dd/mm/yyyy format while the US uses mm/dd/yyyy. and yyyy/mm/dd how can i get this type date format :...
0
by: Karunakararao | last post by:
Hi Vinay I am not able to get the web application. regional settings made at the operating system level. For example, Canada uses a dd/mm/yyyy format while the US uses mm/dd/yyyy. and yyyy/mm/dd...
1
by: John | last post by:
Hi, The following behavior when using J# vs. C# is really bothering me. When I have the regional settings on my workstation set to a non-US settings (eg: Danish); it seems that J# disregards...
2
by: Andy Pickering | last post by:
I made the mistake of leaving the regional settings as US (I'm based in the UK) when I installed my development server (2003 Std). I've set the regional settings back to English (UK) in all of the...
7
by: Fred Flintstone | last post by:
I'm writing a VB.Net windows forms application. This line of code: Personal.EffectiveDate = GridRow2.Cells("New Value").Value.ToString.Trim Fails with this error: Cast from string...
4
by: adi | last post by:
Hi I'm using .NET Framework 1.1 My application needs to read the system's language settings. How to do this? Thanks.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.