473,498 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Convert.ToDateTime issue

Hi

I am using System.Convert.ToDateTime to convert a date from a DB to datetime
type. The only trouble is it works one way on my local computer and another
way on our production server.

Being located in Canada I get: 4/13/2005 for April 13 2005
Our production server also located in Canada about 40mins away: 13/4/2005
for April 13 2005.

The DateTime conversion fails because it does not recognise the 13th month!
Where on the server do I have to change the date time format/regional
settings.

Another twist is that I don't have hands on, only through Terminal Services
so I have to get the hosting company to change it.

I had them change it to Canada for Regional settings and the date time
format for Canada.

It is still formatting wrong. Is there anywhere else that we have to change
it? Do I need to reboot the server?

Tim Cowan

Nov 17 '05 #1
1 5528
Hi,

Not sure but just try to get the date in some specific format. I mean
don;t just do System.Convert.ToDateTime. After getting DateTime use
DateTime.ToString() method to format date explicitly in any form you
want.

For more info:
http://msdn.microsoft.com/library/de...tringTopic.asp

HTH,
Regards,
Angrez

Nov 17 '05 #2

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

Similar topics

4
1392
by: | last post by:
I have two text boxes; startTimeTextBox.Text = "08:00"; endTimeTextBox.Text = "15:00"; and now I will check if startTimeTextBox.Text starts really before endTimeTextBox.Text something like...
2
5061
by: Franck | last post by:
Hi, 'm gettin mad about date conversion. Here is the point. Got and add-in for Excel which call functions from a web service (on a remote server) The remote server has regional settings...
5
18686
by: simon | last post by:
I have datetime variable: Datetime tsEndTime; Should I use (DateTime): tsEndTime=(DateTime)rdr.GetValue(15) or is better to use: tsEndTime=Convert.ToDateTime(rdr.GetValue(15))
2
1187
by: Kylin | last post by:
eg : 19820507 1982-12-12 -- FireCrow Studio Kylin Garden EMail:gaotianpu@gmail.com ICQ:156134382
0
4841
by: RSH | last post by:
I am having a bit of trouble filling a datatable with a query. I'm getting the error message: System.FormatException: String was not recognized as a valid DateTime. at...
2
2973
by: SimonZ | last post by:
Hi, can someone explain me, when to use: (DateTime)DataBinder.Eval(Container.DataItem, "dateField") OR Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "dateField")) Sometimes...
4
35834
by: tshad | last post by:
Is there any difference between convert.ToDateTime and System.DateTime.Parse? I am using them both and they seem the same. Is one better to use than another? Thanks, Tom
3
8670
by: John | last post by:
I'm getting this error when i'm trying to databind my dataset to a dropdown: DataBinding: 'System.Data.DataRowView' does not contain a property with the name '12/12/2003' but if I do a...
4
2973
by: =?Utf-8?B?YW5kcmV3?= | last post by:
I am running an ASP.net program written in VB. At one point I try to convert a date string into a date time object... this string is from a central dev server and the code works on many other...
0
7125
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
7205
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...
1
6887
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...
1
4910
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
4590
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
3093
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
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1419
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
291
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.