473,407 Members | 2,314 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,407 software developers and data experts.

ParseExact problem

Please see the following code where i am trying to parse a date time string:

DateTime dt = DateTime.ParseExact("08/02/2005", "dd/mm/yyyy", null);

When doing a watch on dt the date get sets to 1/8/2005

This happens for any date string that i try to parse - any ideas.

Thanks,
Dermot.
Nov 17 '05 #1
2 1404
Dermot,

Yes because you probably want to use the month MM and not the minutes mm
which are not in your string.

:-)

Cor
Nov 17 '05 #2
Cor,

that was it - silly mistake.

Thanks for your help with this.

Dermot.

"Cor Ligthert" <no************@planet.nl> wrote in message news:<eQ**************@TK2MSFTNGP09.phx.gbl>...
Dermot,

Yes because you probably want to use the month MM and not the minutes mm
which are not in your string.

:-)

Cor

Nov 17 '05 #3

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

Similar topics

0
by: Fred Strauss | last post by:
I am having an odd problem using the DateTime.ParseExact() method that I'm hoping someone can help me with. I have XML files that use 2 different date formats internally. I am trying to use the...
3
by: Dave P. | last post by:
I'm trying to parse a string into a DateTime object. I want to try using ParseExact to see if I can improve performance of a frequently-called method (i.e., please don't suggest using Parse()). ...
5
by: ramon.smits | last post by:
I'm trying to get the following date/time string formatted. But I don't succeed. I get an exception saying the date/time string is invalid. string input = "8/09/05 9:27a"; string format =...
11
by: Cor Ligthert | last post by:
Hello everybody, Jay and Herfried are telling me every time when I use CDate that using the datetime.parseexact is always the best way to do String to datetime conversions. They don't tell why...
1
by: Pablo | last post by:
Hello, I have big problem with method ParseExact from class DateTime. Here is code sample: ...
1
by: Erica | last post by:
Hi. I have a string: "11/24/2006 23:59" named StartDateTime I need the string to be converted into a DateTime object in the following format: 2006-11-24 11:59 PM I tried the following:...
3
by: Peter Duniho | last post by:
I'm sure there's a good explanation for this, but I can't figure it out. I tried using DateTime.Parse() with a custom DateTimeFormatInfo instance, in which I'd replaced the...
11
by: Peter Holschbach | last post by:
Hi, I've the following line of code: result = DateTime.ParseExact("1999-12-01T23:59:59Z", "yyyy-MM-ddTHH:mm:ssZ", CultureInfo.InvariantCulture); where I get in result "result" "02.12.1999...
5
by: John B | last post by:
Hi all, Any idea why this code results in a FormatException? DateTime.ParseExact("40708", "dMMyy", CultureInfo.CurrentCulture) If I use "040708" with the same format string it works and it...
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: 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
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
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...
0
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
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
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...

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.