473,385 Members | 1,766 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.

dayofweek regional settings?

Hello

I just installed a win2k server with sql2k and when i run
datepart(wk,getdate()) it gives the american day of week, not european were
monday =1 how do i fix that? can i set something in control panel?
everywhere i look in regional settings I see it all set to swedish

/Lasse
Jul 19 '05 #1
1 1838


Lasse Edsvik wrote:

I just installed a win2k server with sql2k and when i run
datepart(wk,getdate()) it gives the american day of week, not european were
monday =1 how do i fix that? can i set something in control panel?
everywhere i look in regional settings I see it all set to swedish


The VBScript documentation for DatePart tells that Sunday is assumed as
the first day of the week unless you pass in the third argument to DatePart.
Here is an example:

<%@ Language="VBScript" %>
<%
Dim currentDate
currentDate = Now
Response.Write "<p>" & currentDate & "</p>"
Response.Write "<p>" & DatePart("w", currentDate) & "</p>"
Response.Write "<p>" & DatePart("w", currentDate, vbMonday) & "</p>"
Response.Write "<p>" & DatePart("w", currentDate, vbUseSystemDayOfWeek)
& "</p>"
%>

Here on my German Windows XP system the output is

12.03.2004 17:39:09

6

5

5

which means you either need to pass in vbMonday to explictly use that as
the first day of the week or you can pass in vbUseSystemDayOfWeek as
then the system settings are used (which I understand from your post
should be Monday as the first day of the week)

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 19 '05 #2

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...
1
by: nerman | last post by:
Hello I have a problem with the regional settings. I have set the regional settings of the web server to display the numbers in this format 123.456,78 But when I open my web site all number are...
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...
2
by: Bob Dydd | last post by:
Hi Everbody Question Changing the regional settings ie. from UK to US AUS etc, Access retains the original currency format that the application was created in. So if an mdb that is written...
3
by: Emmanuel | last post by:
I want to know the decimal separator and the group separator character that the user has set in Regional Settings in Control Panel. I tryied to use...
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...
12
by: magister | last post by:
Hello, I know I can set the Culture to what I want, but shouldn't the current culture be taken from the regional settings on the web server's control panel!!! Mine is set to "united kingdom"...
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...
16
by: Colmag | last post by:
I've written an application with vb.net 2003 (framework 1.1) which automates a 3rd party viewing/printing application (via an activex control). I've released several versions over the last year...
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: 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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...

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.