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

Home Posts Topics Members FAQ

Getting wrong date in DateTime.Parse function

1 New Member
Hi All,
I am getting wrong date when I am using DateTime.Parse function. The following is the code..

DateValue = DateTime.Parse( datarow[column1].ToString()).To String("MM/dd/yyyy");

I am taking the data from a proc keeping it in a datarow. While displaying the value I am getting the date value one less then it is in the DB. e.g. 3/31/2010 values comes as 3/30/2010 (for some timezone). This is a code written by someone else so basically I need to know basically the reason. I searched in google and I think it might be avoided by using DateTime.ParseE xtract. But I need to know the reason why DateTime.Pase() doesnot return correct result. I need it urgently folks. So please help me get rid of my headache.

Thanx in advance
Dec 23 '09 #1
0 2109

Sign in to post your reply or Sign up for a free account.

Similar topics

8
9428
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 $ Last-Modified: $Date: 2003/10/28 19:48:44 $ Author: A.M. Kuchling <amk@amk.ca> Status: Draft Type: Standards Track
3
35059
by: Jon Davis | last post by:
The date string: "Thu, 17 Jul 2003 12:35:18 PST" The problem: // this fails on PST DateTime myDate = DateTime.Parse("Thu, 17 Jul 2003 12:35:18 PST"); Help? Jon
6
3288
by: Willie wjb | last post by:
Hi, i have a client program that sends a filter expression to the server PC. On that server PC this filter is put over a datatable and the result is send back. the server can be located on a PC with let's say ddmmyyyy windows date format and the client has mmddyyyy. when the filter expression send is "Date < #31/01/2003#", it will fail...
4
5556
by: jty202 | last post by:
I have string that contains a date in this format (14-Jan-05). I want to store in date object if theres one and access each part of the date (month, year, dates, day of week). Specifically I want to convert it in this format 20050114 because this way, I can compare it with another date in this format to see which is greater. Can something...
11
1553
by: simon | last post by:
I have the name of a day like for example 'Mon' Is there some function which returns the number of a weekDay if you have the day name or I should write the select case statements? If the day is 'Mon' then result should be 2. Thank you, Simon
15
18869
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 the value in timeonly format by using this command Format(now,"HH:mm:ss") But when I insert it into the Sql Server database, it embadded date value...
8
1372
by: JFB | last post by:
Hi All, I'm trying to find if a file name that includes the date is before todays to do some procedures. In my IF statement is working is just a few dates before but not is a year before. How can I fix this? Tks in advance... This is what I have: 'Set today's date
9
2658
by: Andrew Gwozdziewycz | last post by:
I've been looking recently for date processing modules that can parse dates in forms such as "next week" or "6 days from next sunday". PHP has a function that will do this called 'strtotime', but I have not found a Python implementation. I've check the standard date, datetime and time modules and also mx.Date* modules. Am I overlooking...
21
3350
by: Darin | last post by:
I have an applicatoin that works 100% perfect when running on a machine setup for English (United States), but when I change it to Spanish (Mexico), the dates start giving me fits. THe reason is USA is mm/dd/yyyy and mexico is dd/mm/yyyy. So, with the computer set to mexico, any standard CDATE function is going to return the date in the...
0
7451
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7720
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7475
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7812
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5372
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5089
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1944
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 we have to send another system
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.