Click here to Skip to main content
12,950,099 members (55,324 online)
Rate this:
Please Sign up or sign in to vote.
See more:

I'm facing an issue displaying English date to French format.
I want to display current date in French culture(fr-FR) format as example given below :

English date : 01/20/2011 08:23 pm
French date : 20/01/2011 20:23

Could anybody help in this regard.

Thanks in advanced !! ;)
Posted 16-Jan-11 20:20pm
Updated 16-Jan-11 21:37pm
Dalek Dave433.3K
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

I feel I must point out that the example you used:

English date : 01/20/2011 08:23 pm

Is not the English Date.

The English Date Format is the same as the French Date Format.

ie Day/Month/Year.

Month/Day/Year is the totally illogical order used by Americans.

But surely just assigning it to the French Culture will be enough for the Date to be presented properly?

CultureInfo("fr-FR") should do the trick.
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

Hi All,

I got solution wht i was looking for ,

I wrote following code to display date in french culture format as given below :


Thanks for all your valuable inputs.
Rahul Chitte :)
SAKryukov 17-Jan-11 8:48am
Right, my 5.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Doing this ad hoc is easy. Read this:[^].

However, mixing up cultures in the same run-time of the same application? Hm...

If you want to change culture of the application, the reference by Abhinav may need an extra note. You also need to understand the difference between
System.Threading.Thread.CurrentThread.CurrentCulture<br />
and System.Threading.Thread.CurrentThread.CurrentUICulture.

See the description in Microsoft help. This is an interesting comprehensive article on the topic:[^].

Short and clear article in Dr.Dobbs:[^].
SAKryukov 17-Jan-11 9:26am
Oh, I agree, my Answer is pretty bad.

The only correct Answer (to this particular question) is by rahu_122 -- to his own Question, which I credit with a vote of 5.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

See here[^].
rahu_122 17-Jan-11 2:30am
Yes this answer seems to be correct but it changes the setting for whole application, hence i m getting exception for adding decimal variables in french format.
So is it possible to apply change for only specific variable or object?
Abhinav S 17-Jan-11 2:51am
This might help -
Rate this: bad
Please Sign up or sign in to vote.

Solution 6

I got another better solution.
[in ASP.NET 3.5, C#]
take two labels in "default.aspx"
'Label1' & 'Label2'
now come to the CODE VIEW
add namespace in your code

using System.Globalization;

then enter the specifics code in PAGE_Load event:
protected void Page_Load(object sender, EventArgs e)
        Label1.Text = System.DateTime.Now.ToString(&quot;dd MMM,yyyy&quot;,CultureInfo.GetCultureInfoByIetfLanguageTag(&quot;fr-FR&quot;));
Label2.Text = System.DateTime.Now.ToString(&quot;dddd&quot;, CultureInfo.GetCultureInfoByIetfLanguageTag(&quot;fr-FR&quot;));

you also can use your own date format.
there is some examples of the date-Time Format:

"dd-mm-yy" - 01-01-11
"dd-mmm-yyyy" - 01-jan-2011
"dd mmmm, yyyy" - 01 january, 2011
"dd mmmm, yyyy, hh:mm:ss" - 01 january, 2011, 13:30:15

see ya, :-\

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 5,749
CHill60 3,380
Maciej Los 2,953
Jochen Arndt 1,935
ppolymorphe 1,820

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 6 Feb 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100