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

date/time in different formats

I am having major issues w/ date and time between SQL and the PC.

The SQL database has EVERYTHING as mm/dd/yyyy hh:mm:ss (standard english
datetime).
But, on english PC's it is fine. My problem (right now) is mexico PC's
setup for spanish where the date is dd/mm/yyyy. It seems sometimes when
I read the database the date is autoformatted into the dd/mm/yyyy and
other times it isn't, and I haven't figured out a reason why.

Does anyone have any suggestions as to how to bullet proof globalization
between an always US SQL database and different PC's?

THanks.

Darin

*** Sent via Developersdex http://www.developersdex.com ***
Sep 20 '06 #1
2 1370
Darin,

SQL server *has not* everything in mm/dd/yy hh:mm:ss (which is by the way
not the standard English datetime, but the USA culture DateTime
representation, the standard English DateTime is the same as in Spain with
the difference that a 12 hour clock with pm/am is used)

A DateTime in SQL server is in ticks from 1000/3 milliseconds starting at
the date that the British Empire including their colonies in America started
with the Gregorian calendar. As forever in standardisation cases Britain
was with that the last in the so called western world (although the later is
now taken over by the USA), so that start date works almost in every country
to calculate accurate calendar dates where the Gregorian calendar is used.

Your representation of the datetime will be given depending on the Culture
settings of your computer.

(Be aware that the VB.Net debugger (not the C# one which shows them correct)
can only shows dates in literal format which is in USA notation).

I hope this helps,

Cor

"Darin" <darin_nospam@nospameverschreef in bericht
news:uy**************@TK2MSFTNGP05.phx.gbl...
>I am having major issues w/ date and time between SQL and the PC.

The SQL database has EVERYTHING as mm/dd/yyyy hh:mm:ss (standard english
datetime).
But, on english PC's it is fine. My problem (right now) is mexico PC's
setup for spanish where the date is dd/mm/yyyy. It seems sometimes when
I read the database the date is autoformatted into the dd/mm/yyyy and
other times it isn't, and I haven't figured out a reason why.

Does anyone have any suggestions as to how to bullet proof globalization
between an always US SQL database and different PC's?

THanks.

Darin

*** Sent via Developersdex http://www.developersdex.com ***

Sep 20 '06 #2
What datatype are you using for the column in the SQL database? How are you
reading the data in your VB code?

The bullet proof way to support globalization is to use real date data types
(and ISO format if you need to work with strings for some reason)

/claes

"Darin" <darin_nospam@nospameverwrote in message
news:uy**************@TK2MSFTNGP05.phx.gbl...
>I am having major issues w/ date and time between SQL and the PC.

The SQL database has EVERYTHING as mm/dd/yyyy hh:mm:ss (standard english
datetime).
But, on english PC's it is fine. My problem (right now) is mexico PC's
setup for spanish where the date is dd/mm/yyyy. It seems sometimes when
I read the database the date is autoformatted into the dd/mm/yyyy and
other times it isn't, and I haven't figured out a reason why.

Does anyone have any suggestions as to how to bullet proof globalization
between an always US SQL database and different PC's?

THanks.

Darin

*** Sent via Developersdex http://www.developersdex.com ***

Sep 20 '06 #3

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

Similar topics

8
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
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...
6
by: Suzanne | last post by:
Hi, I am having problems with my website which uses ASP. It is switching between American and European date formats - this is causing problems on the page which use the Date function. Most of...
15
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...
7
by: Marc Pelletier | last post by:
Hello, I have a table with a Day field, defined as smalldatetime. I am filling it from a CSharp application with the following code: DataRow r = dtStaDays.NewRow(); r= station_ID; r =...
9
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...
15
by: Khurram | last post by:
I have a problem while inserting time value in the datetime Field. I want to Insert only time value in this format (08:15:39) into the SQL Date time Field. I tried to many ways, I can extract...
2
by: x | last post by:
hi i am a pilot by profession. i want to create a database of my logbook using ms access 2002. i am facing a problem regarding the format of time field. when i select "Data/Time" data type for my...
20
by: andreas | last post by:
When I copy a vb.net project using date formats from one PC with a windows date format f.e. dd/mm/yyyy to another PC having a format yy/mm/dd then I get errors. How can I change for a while in the...
4
by: Terry | last post by:
I have a TextBox with a date such as 15/01/2006 which I want to cast into a variable as a short date 15/01/06, also I need to cast a time such as 07:30 A.M. into a variable as a short time. What...
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: 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...
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
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
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.