473,387 Members | 1,535 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,387 software developers and data experts.

DateTime.DayOfWeek localisation

Hi there, hope someone can help me on this:

DateTime.Now.DayOfWeek is always returning the american day names like
"Monday, Saturday". Even when my CurrentCulture is set to my localized
culture. I like to have my localized daynames returned. How can I do this?

greets,

Gerben.
Nov 15 '05 #1
3 10530
Write your own class which can read the culture and translate the DayofWeek
according what you have read.

Hope this will help

"Gerben van Loon" <no*************@home.nl> wrote in message
news:bt**********@news1.tilbu1.nb.home.nl...
Hi there, hope someone can help me on this:

DateTime.Now.DayOfWeek is always returning the american day names like
"Monday, Saturday". Even when my CurrentCulture is set to my localized
culture. I like to have my localized daynames returned. How can I do this?

greets,

Gerben.

Nov 15 '05 #2
That is a property that returns an enum - you cannot localize the items in
an enum. You should be using the DayNames property of the
System.Globalization.DateTimeFormatInfo, which is localized based on the
current culture.

"Gerben van Loon" <no*************@home.nl> wrote in message
news:bt**********@news1.tilbu1.nb.home.nl...
Hi there, hope someone can help me on this:

DateTime.Now.DayOfWeek is always returning the american day names like
"Monday, Saturday". Even when my CurrentCulture is set to my localized
culture. I like to have my localized daynames returned. How can I do this?

greets,

Gerben.

Nov 15 '05 #3
Thank you Andrew, works great.

"Andrew (Infragistics)" <pr************@infragistics.com> wrote in message
news:ur**************@TK2MSFTNGP10.phx.gbl...
That is a property that returns an enum - you cannot localize the items in
an enum. You should be using the DayNames property of the
System.Globalization.DateTimeFormatInfo, which is localized based on the
current culture.

"Gerben van Loon" <no*************@home.nl> wrote in message
news:bt**********@news1.tilbu1.nb.home.nl...
Hi there, hope someone can help me on this:

DateTime.Now.DayOfWeek is always returning the american day names like
"Monday, Saturday". Even when my CurrentCulture is set to my localized
culture. I like to have my localized daynames returned. How can I do this?
greets,

Gerben.


Nov 15 '05 #4

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

Similar topics

1
by: Gary Brewer | last post by:
Why did Microsoft decide to start the DateTime.DayOfWeek enumeration with Sunday and ending on Saturday. I thought that a week began on Monday rather than Sunday? Or is this an age old unresolved...
14
by: | last post by:
Hi! I will get the date from now (DateTime.Now is 18.12.2003) but exact 16 years ago (18.12.1987). when I make something like this: //we set min. employee age to 16 years TimeSpan...
2
by: Simple Simon | last post by:
Hi all, I'm struggling with an elegant way to figure out if a DateTime falls between any Firday @ 6pm and Sunday @ 9pm. For example: If i want to fax a message b/w Fri 6pm and Sun 9pm on any...
4
by: M | last post by:
Hello, I have code like dt.DayOfWeek.ToString(CultureInfo.CurrentCulture) where dt is a DateTime object. I get something like "Sunday", "Monday", etc... while I'm expecting it to be in...
7
by: .Net Sports | last post by:
Before processing my data in a datagrid, I need to parse the day of the week (which will be my 'rqsday' variable) from a string that comes over on a querystring: string rqs =...
8
by: simon | last post by:
dateTime sellDate; int16 dayOfWeek; dayOfWeek=sellDate.DayOfWeek I would like to set that monday is the first day of a week and not sunday. Any idea? In VB there is a function, where you...
5
by: What-a-Tool | last post by:
Have a group of dynamically created text boxes in a calendar like grid. At the head of each column, the textbox is to contain the day of the week. Now I am using a Select Case statement to...
2
by: Paulers | last post by:
Hello Is it possible to create a DateTime structure that does not include the date? I am only intrested in the time and day. for example 23:00 Mon. I would eventually like to add and subtract...
2
by: David P. Donahue | last post by:
Probably a simple question: I have a function that receives as an argument a DateTime value. One of the things I want to do is check to see if it's a weekday. So I do the following (sorry for...
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.