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

Dates displaying in US format

Hello,

I have written a webpage that displays details of some files on the
webserver. It includes the following lines:
FileInfo fi = new FileInfo(file);
cell.Text = fi.CreationTime.ToString();

It works OK, except that the date is displayed in US format
(month/day/year), not UK format. The help file for DateTime.ToString says
"This method uses formatting information derived from the current culture".
So obviously, the 'current culture' is set incorrectly. Where and how do I
change this?

Thanks.
Nov 18 '05 #1
3 1006
If you need always the same formatting, you could change it using the
web.config file (see the Globalization entry in the documentation).

If you need to work with multiple culture you could also set it
programmatically using Page.Culture or by changing the culture on the
current thread....

Patrice

--

"Sheila Jones" <sh**********@btopenworld.com> a écrit dans le message de
news:eC**************@TK2MSFTNGP12.phx.gbl...
Hello,

I have written a webpage that displays details of some files on the
webserver. It includes the following lines:
FileInfo fi = new FileInfo(file);
cell.Text = fi.CreationTime.ToString();

It works OK, except that the date is displayed in US format
(month/day/year), not UK format. The help file for DateTime.ToString says
"This method uses formatting information derived from the current culture". So obviously, the 'current culture' is set incorrectly. Where and how do I
change this?

Thanks.


Nov 18 '05 #2
Hello Patrice,

Thank you for your reply. But why doesn't ASP.Net default to using the
machine's Regional Settings? That would seem more logical to me.
"Patrice Scribe" <no****@nowhere.com> wrote in message
news:eX**************@TK2MSFTNGP09.phx.gbl...
If you need always the same formatting, you could change it using the
web.config file (see the Globalization entry in the documentation).

If you need to work with multiple culture you could also set it
programmatically using Page.Culture or by changing the culture on the
current thread....

Patrice

--

"Sheila Jones" <sh**********@btopenworld.com> a écrit dans le message de
news:eC**************@TK2MSFTNGP12.phx.gbl...
Hello,

I have written a webpage that displays details of some files on the
webserver. It includes the following lines:
FileInfo fi = new FileInfo(file);
cell.Text = fi.CreationTime.ToString();

It works OK, except that the date is displayed in US format
(month/day/year), not UK format. The help file for DateTime.ToString says "This method uses formatting information derived from the current

culture".
So obviously, the 'current culture' is set incorrectly. Where and how do I change this?

Thanks.

Nov 18 '05 #3
Good point though this sometimes not easy (should the system default or the
account default used ?).
The nice thing with web.config is that you have control without regards to
server settings...

For now I'm unable to find where in the doc is specified what the default
cutlture should be...
(we have no problem here as we usually set it from the user profile).

Patrice

--

"Sheila Jones" <sh**********@btopenworld.com> a écrit dans le message de
news:uI**************@TK2MSFTNGP11.phx.gbl...
Hello Patrice,

Thank you for your reply. But why doesn't ASP.Net default to using the
machine's Regional Settings? That would seem more logical to me.
"Patrice Scribe" <no****@nowhere.com> wrote in message
news:eX**************@TK2MSFTNGP09.phx.gbl...
If you need always the same formatting, you could change it using the
web.config file (see the Globalization entry in the documentation).

If you need to work with multiple culture you could also set it
programmatically using Page.Culture or by changing the culture on the
current thread....

Patrice

--

"Sheila Jones" <sh**********@btopenworld.com> a écrit dans le message de
news:eC**************@TK2MSFTNGP12.phx.gbl...
Hello,

I have written a webpage that displays details of some files on the
webserver. It includes the following lines:
FileInfo fi = new FileInfo(file);
cell.Text = fi.CreationTime.ToString();

It works OK, except that the date is displayed in US format
(month/day/year), not UK format. The help file for DateTime.ToString says "This method uses formatting information derived from the current culture".
So obviously, the 'current culture' is set incorrectly. Where and how
do I change this?

Thanks.



Nov 18 '05 #4

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

Similar topics

4
by: F | last post by:
Hi I have posted the question few days back about problem in inserting the dates in SQL server and thankful to them who replied. That was solved and this is a nice solution....
1
by: Alicia | last post by:
I basically wanted something that would do a count of the dates, then group them by their week name.. BEFORE: Resource Date Total number of times that date Appeared (Count) 4/3/03 ...
1
by: GAVO | last post by:
Hello. I have a form with four fields; Year, Month, FirstDay, LastDay. the form is used to get the first and last day of on month using the fields "Year" and "Month" to display the dates I...
5
by: nbohana | last post by:
I have a windows form with several fields. One of the fields is a date. I use DateTimePicker to enter and format the date. In my SQL table the date si stored as follows "01/10/2005" and this is...
2
by: Jon | last post by:
I have an asp.net app that I've localized using satellite assemblies. It works wonderfully, even for displaying dates. My problem comes when I try to use one of those dates in a SQL query. I...
2
by: xenophon | last post by:
I am trying to format datetime output with an HTTP Module. Right now dates are displaying in US format like "MM/DD/YYYY 12:00:00". I want to change the output to "MM/DD/YYYY" if US or "DD.MM.YYYY"...
1
by: David Lozzi | last post by:
Howdy, Users can specify a date in a field labeled dtDate. This field in SQL is a smalldatetime. When I vew the raw data in the table, it displays 9/29/2008, and when a user doesn't specify a...
0
by: news | last post by:
This had me stumped for ages yesterday, and since I solved it and can't find much reference to the problem, I thought I'd post here. I have various vbscript ASP pages that take an ADO recordset...
9
by: Bosconian | last post by:
I must be having a brain freeze because I can't figure out how to display dates older than 1970. I have birth dates stored in MySQL as "date" data types (exp. 1955-04-06). I'd like to display as...
8
by: rjlorenzo | last post by:
Good Day Everyone, Requesting for your expertise please, in my program the user has to enter the agent name and the from date and to date inorder to display the record. I have to use 2 conditions....
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...
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...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.