PC Review


Reply
Thread Tools Rate Thread

DateTime::Parse problem

 
 
=?Utf-8?B?Q2hyaXN0bw==?=
Guest
Posts: n/a
 
      26th Jan 2004
Hi all,

I'm running, or trying to run, a managed C++ application on the .Net framework 1.0 on a Win 98 SE machine, with intel processor(no other details at this point).

I'm getting the following error, and can't figure out why exactly.

"system.format.exception "String was not recognised as a valid datetime at system.datetimeparse.getdayofnnn( dateTimeResult result.datetime RawInfo Raw.datetimeformatinfo dtfi)"

(This message was read out over the phone so may not be completely accurate)

I've set up a test machine with Win 98 SE os, but can't duplicate the error. Looking at my code, I have a line that reads;

"DateTime::Parse(daGolf->m_DateTourneyStarted)" where the value in daGolf->m_DateTourneyStarted = "26/01/04".

I'm guessing the problem must lie in the date value, and if I convert it to "26/01/2004" it might go away. But why hasn't it occured on Win XP, Win ME, or my test machine with Win 98 SE?

Any insight into this would be appreciated.

Regards,

Christo
 
Reply With Quote
 
 
 
 
Jerry III
Guest
Posts: n/a
 
      26th Jan 2004
You need to pass valid format provider to the Parse method - either a
hardcoded one (seems tobe your case as you expect a single format that will
always be the same) or one based on user's locale (which is the default, the
user that runs your code has a different date format setup than what they're
entering).

Jerry

"Christo" <(E-Mail Removed)> wrote in message
news:3442CDFA-9916-4E7F-8E87-(E-Mail Removed)...
> Hi all,
>
> I'm running, or trying to run, a managed C++ application on the .Net

framework 1.0 on a Win 98 SE machine, with intel processor(no other details
at this point).
>
> I'm getting the following error, and can't figure out why exactly.
>
> "system.format.exception "String was not recognised as a valid datetime at

system.datetimeparse.getdayofnnn( dateTimeResult result.datetime RawInfo
Raw.datetimeformatinfo dtfi)"
>
> (This message was read out over the phone so may not be completely

accurate)
>
> I've set up a test machine with Win 98 SE os, but can't duplicate the

error. Looking at my code, I have a line that reads;
>
> "DateTime::Parse(daGolf->m_DateTourneyStarted)" where the value in

daGolf->m_DateTourneyStarted = "26/01/04".
>
> I'm guessing the problem must lie in the date value, and if I convert it

to "26/01/2004" it might go away. But why hasn't it occured on Win XP, Win
ME, or my test machine with Win 98 SE?
>
> Any insight into this would be appreciated.
>
> Regards,
>
> Christo



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help: DateTime.Parse CultureInfo Problem kilaen@gmail.com Microsoft Dot NET Framework 1 6th Apr 2007 12:19 AM
DateTime Parse and CultureInfo problem. dotnw@hotmail.com Microsoft Dot NET Framework 2 2nd Dec 2004 02:35 PM
Re: DateTime.Parse() problem with non-US dates Lateralus [MCAD.Net] Microsoft C# .NET 0 24th Aug 2004 08:42 PM
Problem with DateTime.Parse Tobias Olbort Microsoft Dot NET 2 8th Aug 2003 04:45 PM
Problem with DateTime.Parse Tobias Olbort Microsoft Dot NET Framework 1 8th Aug 2003 02:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:57 AM.