|
-
Apr 25th, 2007, 08:12 AM
#1
Thread Starter
Member
[RESOLVED] Weird String to Date error
im using this to convert a date
_dtestart = Date.Parse("20/04/2007")
This gives no errors when testing the program on the device it , does so on the emulator , anyone know why ?
-
Apr 25th, 2007, 12:06 PM
#2
Frenzied Member
Re: Weird String to Date error
Hi,
take a look at the regional settings on the PC - my guess is they are set to US
Pete
-
Apr 26th, 2007, 04:34 AM
#3
Fanatic Member
Re: Weird String to Date error
the best way to parse a date is to use yyyy/mm/dd as this does not cause a problem if you regional settings are set for having dates in the format dd/mm/yyyy
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Apr 26th, 2007, 07:39 AM
#4
Thread Starter
Member
Re: Weird String to Date error
Well ive been using date.parseexact or , Cdate("") too , with every possible "dd/MM/yyyy" and stuff , but still no avail , constant format exception.
As long as it works on the device im fine tho.
-
Apr 26th, 2007, 07:56 AM
#5
Fanatic Member
Re: Weird String to Date error
_dtestart = Date.Parse("2007/04/20") should work everytime
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Apr 27th, 2007, 10:27 PM
#6
Re: Weird String to Date error
Have you checked out Pete's suggestion? I think you have a different regional setting on each one. That's a european style date, which won't do so well in a non-european setting.
My usual boring signature: Nothing
 
-
Apr 30th, 2007, 05:27 AM
#7
Thread Starter
Member
Re: Weird String to Date error
Im dont have the rights to change regional settings so cant really try that out.
But i think Pete's solution is the most viable , this computer is set with US settings the PDa is with European settings.
thx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|