473,513 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Date Formats

Hi,

I'm entering a date into an SQL server using an Infragistics control. The
control picks the date format up from the system setting (UK). When the date
is entered into the database, it thinks its in US format and switches the
month & day.

In the stored procedure thats storing the data I have 'SET DATEFORMAT dmy'
which I though was supposed to tell SQL that incoming dates are in the
format specified, rather than the default mdy.

Can anyone help?

Thanks
Nov 19 '05 #1
4 1226
Did you checked up by changing your
machine date format (Regional Settings)
to UK type?

Vadivel Kumar
http:\\charpblogs.blogspot.com

"Nick" <Ni**@NTWorks.no.spam.fsnet.co.uk> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl...
Hi,

I'm entering a date into an SQL server using an Infragistics control. The
control picks the date format up from the system setting (UK). When the
date is entered into the database, it thinks its in US format and switches
the month & day.

In the stored procedure thats storing the data I have 'SET DATEFORMAT dmy'
which I though was supposed to tell SQL that incoming dates are in the
format specified, rather than the default mdy.

Can anyone help?

Thanks

Nov 19 '05 #2
Yes - All the PC settings are UK English.
"Vadivel Kumar" <do********@spam-i-love-u.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Did you checked up by changing your
machine date format (Regional Settings)
to UK type?

Vadivel Kumar
http:\\charpblogs.blogspot.com

"Nick" <Ni**@NTWorks.no.spam.fsnet.co.uk> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl...
Hi,

I'm entering a date into an SQL server using an Infragistics control. The
control picks the date format up from the system setting (UK). When the
date is entered into the database, it thinks its in US format and
switches the month & day.

In the stored procedure thats storing the data I have 'SET DATEFORMAT
dmy' which I though was supposed to tell SQL that incoming dates are in
the format specified, rather than the default mdy.

Can anyone help?

Thanks


Nov 19 '05 #3
"Nick" <Ni**@NTWorks.no.spam.fsnet.co.uk> confessed in
news:e9**************@TK2MSFTNGP10.phx.gbl:
Hi,

I'm entering a date into an SQL server using an Infragistics control. The
control picks the date format up from the system setting (UK). When the date is entered into the database, it thinks its in US format and switches the
month & day.

In the stored procedure thats storing the data I have 'SET DATEFORMAT dmy' which I though was supposed to tell SQL that incoming dates are in the
format specified, rather than the default mdy.

Can anyone help?

Thanks


What is your default language set to? It defaults to English, which is
American english, and will do a mdy format.

You want British English, which defaults to dmy

You can do this in Enterprise manager (Server properties), with the SET
LANGUAGE command in your script, or with sp_setdefaultlanguage (look that
one up...I may have it wrong).

-- ipgrunt

Nov 19 '05 #4
Hello Nick,

This is because the language specified in the sql server install is US English.
What happens when you pull the date back out of the sql server?

I'm guessing it comes back in UK format.

--
Matt Berther
http://www.mattberther.com
Hi,

I'm entering a date into an SQL server using an Infragistics control.
The control picks the date format up from the system setting (UK).
When the date is entered into the database, it thinks its in US format
and switches the month & day.

In the stored procedure thats storing the data I have 'SET DATEFORMAT
dmy' which I though was supposed to tell SQL that incoming dates are
in the format specified, rather than the default mdy.

Can anyone help?

Thanks


Nov 19 '05 #5

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

Similar topics

8
9425
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
3
3719
by: praba kar | last post by:
Dear All, I have doubt regarding date string to time conversion function. In Python I cannot find flexible date string conversion function like php strtotime. I try to use following type...
15
42977
by: Simon Brooke | last post by:
I'm investigating a bug a customer has reported in our database abstraction layer, and it's making me very unhappy. Brief summary: I have a database abstraction layer which is intended to...
4
5345
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and...
4
43519
by: Matteo | last post by:
Hy everybody. I'm not a html writer, but a sysadmin who's trying to help a user able to compile an online form with IE but not with Mozilla (Moz1.6, Ns7.1, Firefox 0.8+) due to a javascript date...
36
11289
by: Martin Herrman | last post by:
Dear scripters, I am working on a HTML form in which a date must be entered of the form 'dd-mm-yyyy'. Now I'm looking for a script that, when the user switches to another form field, changes...
6
4824
by: Jim Davis | last post by:
Before I reinvent the wheel I thought I'd ask: anybody got a code snippet that will convert the common ISO8601 date formats to a JS date? By "common" I mean at the least ones described in this...
3
1424
by: Leo Muller | last post by:
Hi, Very often I have a problem with date formats. There are cases I have to cast the date to text and from text to date on a different server. However, sometimes the date formats on the servers...
9
3214
by: Bob Achgill | last post by:
I would like to use the timestamp on files to manage the currency of support files for my VB windows application. In this case I would only put the timestamp of the file in the management database...
9
1563
by: SOLVER | last post by:
Hi, I can't figure out why this is not working propelly: date("d.m.Y",strtotime("05/03/2008 00:00:00")); result: 03.05.2008 date("d.m.Y",strtotime("18/05/2008 00:00:00")); result:...
0
7260
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
7384
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,...
1
7101
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
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5686
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
4746
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...
0
3234
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1596
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.