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

DATEFORMAT based on reginoal settings

Hi all
How can i get the "Short Date Format" from regional and language
options
Like "MM/dd/yyyy"
how can get this type of format based regional settings;
I wnat to show this format in web application.

Regards
Venu
Nov 16 '05 #1
5 12547
Hi, try this:

CultureInfo culture = new CultureInfo( "en-US" );
DateTime date = DateTime.Now;
System.Threading.Thread.CurrentThread.CurrentCultu re = culture;

MessageBox.Show( date.ToShortDateString() );
Nov 16 '05 #2
Hi i want like this I dont want dates "09/02/2004"
I want format lke this "dd/mm/yyyy"
from regional settings

Regards
Venu.

"Santi" <__***********@ibcentre.es> wrote in message
news:cj**********@nsnmrro2-gest.nuria.telefonica-data.net...
Hi, try this:

CultureInfo culture = new CultureInfo( "en-US" );
DateTime date = DateTime.Now;
System.Threading.Thread.CurrentThread.CurrentCultu re = culture;

MessageBox.Show( date.ToShortDateString() );

Nov 16 '05 #3
Try something like
CultureInfo.CurrentCulture.DateTimeFormat.ShortDat ePattern

Chris Jobson

"Karunakararao" <ka************@i-vantage.com> wrote in message
news:uf**************@TK2MSFTNGP12.phx.gbl...
Hi i want like this I dont want dates "09/02/2004"
I want format lke this "dd/mm/yyyy"
from regional settings

Regards
Venu.

"Santi" <__***********@ibcentre.es> wrote in message
news:cj**********@nsnmrro2-gest.nuria.telefonica-data.net...
Hi, try this:

CultureInfo culture = new CultureInfo( "en-US" );
DateTime date = DateTime.Now;
System.Threading.Thread.CurrentThread.CurrentCultu re = culture;

MessageBox.Show( date.ToShortDateString() );


Nov 16 '05 #4
Hi Karunakararao,

Add this at top of code :

using System.Globalization;

Then try this :

MessageBox.Show(CultureInfo.CurrentCulture.DateTim eFormat.ShortDatePattern);

You can replace ShortDatePattern with LongDatePattern,
FullDateTimePattern or whatever suits your needs. Use Intellisense to
discover more patterns.

HTH,
Michel

"Karunakararao" <ka************@i-vantage.com> wrote in message news:<e7**************@TK2MSFTNGP14.phx.gbl>...
Hi all
How can i get the "Short Date Format" from regional and language
options
Like "MM/dd/yyyy"
how can get this type of format based regional settings;
I wnat to show this format in web application.

Regards
Venu

Nov 16 '05 #5
Hi Chris Jobson

Thanks for your suggestion, the one which you mentioned is working only in
Windows application but not in WebApp.Any clue?

Regards
Venu
"Chris Jobson" <ch**********@btinternet.com> wrote in message
news:eH**************@TK2MSFTNGP14.phx.gbl...
Try something like
CultureInfo.CurrentCulture.DateTimeFormat.ShortDat ePattern

Chris Jobson

"Karunakararao" <ka************@i-vantage.com> wrote in message
news:uf**************@TK2MSFTNGP12.phx.gbl...
Hi i want like this I dont want dates "09/02/2004"
I want format lke this "dd/mm/yyyy"
from regional settings

Regards
Venu.

"Santi" <__***********@ibcentre.es> wrote in message
news:cj**********@nsnmrro2-gest.nuria.telefonica-data.net...
Hi, try this:

CultureInfo culture = new CultureInfo( "en-US" );
DateTime date = DateTime.Now;
System.Threading.Thread.CurrentThread.CurrentCultu re = culture;

MessageBox.Show( date.ToShortDateString() );



Nov 16 '05 #6

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

Similar topics

0
by: Phil | last post by:
My regional setting (on Win2000) is: (General Tab)Locale = English (US) (Date Tab), short date = MM/dd/yy When I ask .Net DateFormat.ShortDatePattern, I get MM/dd/yyyy Now, where does the...
2
by: Grant Merwitz | last post by:
Hi I have installed my web app on a Windows 2003 server. The Regional and Language was originally set to American. Now we have changed it to UK, and are trying to get the DateFormat right. ...
4
by: newtophp2000 | last post by:
Hello, I receive a file containing some character fields along with a date. The date values in the file are formatted as "dd/mm/yy", that is 2-digit day, 2-digit month, and 2-digit year. The...
3
by: Geethu03 | last post by:
Hello In my table Date field contains the datatype Date.but i want to change the DateFormat as i requried,for this i used date_format(date,'%d-%m-%Y') The %m starts with the (00-12) In...
1
by: afernandeziii | last post by:
Hi everyone, Please help! what's the correct syntax using DateFormat in SQL Server 2005. Example. 05/04/07 00:00:00 i need this date show like this 05/04/07 i this regard the time. Anyone...
0
by: pankajol82 | last post by:
Hi all I am using following code to change regional setting at run time its not giving any error but at the same time the format of date is not changing. Dim DateFormat As New...
1
zigman68
by: zigman68 | last post by:
I have a problem with the DateFormat() Function that is driving me nuts! I am downloading a csv and then parsing through it, then inserting into a SQL 2005 DB. Here is the problem. ... A number of...
3
dzenanz
by: dzenanz | last post by:
String input="4/3/08 9:57 AM"; DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT); StartDate = df.parse(input); out.println(StartDate.toLocaleString());//"Apr 3, 2008 12:00:00 AM" ...
2
by: danasegarane | last post by:
Hi all I am having a Date as 01-09-2008".(mm-dd-yyyy") Now I am passing this date to WeekDay Function. This Function is not formating that to Regional settings . This format it as "dd-mm-yyyy"....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.