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

date problem

Hi
I'm using asp.net , visual studio.NET 2003 , c#.
I have a problem that occurred only on my computer And not on other
developer's computers.
My CultureInfo.CurrentCulture is "he-IL"
But when I'm using :
DateTime.Now.ToShortDateString() (my short date format is dd/mm/yyyy)
The function return every time a different date like "06/25/2004)
even that the current date is "06/12/2004"

Also, when I'm using DateTime.Parse("05/05/05")
I'm getting the following error :
System.SystemException {"Could not determine the order of year, month, and
date from dd/mm/yyyy."}
Thanks,
Danny

Nov 16 '05 #1
2 2055
I personally always use "dd MMM yyyy" when passing dates around as a string,
so that the field ordering cannot be confused, then if the client wishes to
have the date format in dd/mm/yy, I simply render it as such.

05/05/05 is confusing. It would depend on what country your in (i.e. localle
settings)

We've had an issue with Sql Server where an app I write with all the localle
settings on the machine and applications set to UK, and we passed the date
as dd/mm/yyyy. Every month it would fall over as soon as it got to say the
5th of the 5th, because Sql Server would apparently revert back to the US
dates (mm/dd/yyyy) and so would get to the 6th of the 5th and suddenly we're
jumping a month ahead!

"Danny" <Da***@discussions.microsoft.com> wrote in message
news:76**********************************@microsof t.com...
Hi
I'm using asp.net , visual studio.NET 2003 , c#.
I have a problem that occurred only on my computer And not on other
developer's computers.
My CultureInfo.CurrentCulture is "he-IL"
But when I'm using :
DateTime.Now.ToShortDateString() (my short date format is dd/mm/yyyy)
The function return every time a different date like "06/25/2004)
even that the current date is "06/12/2004"

Also, when I'm using DateTime.Parse("05/05/05")
I'm getting the following error :
System.SystemException {"Could not determine the order of year, month, and
date from dd/mm/yyyy."}
Thanks,
Danny

Nov 16 '05 #2
"Danny" <Da***@discussions.microsoft.com> wrote:
(my short date format is dd/mm/yyyy)


If I'm not mistaken, you should use 'M' for months. 'm' is
milliseconds.

P.
Nov 16 '05 #3

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

Similar topics

1
by: Laurence Neville | last post by:
This is regarding a change in the Short Date format under Hebrew Regional Settings, that has caused huge problems in our ASP web application. The change appears to have been introduced sometime...
7
by: martini | last post by:
Need help: I am trying to call a DB2 stored procedure that requires parameters: 4x int, date, varchar, int. I use VB6 & oledb. I'm using statements: cmd.CommandText = "{call db2admin.proc(1, 0,...
11
by: David B | last post by:
I have 2 querys with the following in the date criteria Between DateAdd("m",-6,(!!)) And (!!) Between DateAdd("m",-24,(!!)) And DateAdd("m",-6,(!!)) Problem is they both look at the same...
3
by: Dustin Wilson | last post by:
I have a problem with the following line of code. rstOutput! = FormatDateTime("January 1, 2004", vbLongDate) When I run this on my computer at home it runs without problem but when I run it at...
3
by: Lyn | last post by:
Hi, I am developing a project in which I am checking for records with overlapping start/end dates. Record dates must not overlap date of birth, date of death, be in the future, and must not...
2
by: Julie Wardlow | last post by:
Help! I am calculating a future date using the DateAdd function in a query (the calculation also involves an IIf statement), and have managed to get this formula to produce the required result....
1
by: TN Bella | last post by:
Hello, I was looking through the older posts for a solution to this problem, but I am still confused on how to fix my problem. There are two dates on my form, one (txtInvDate) is entered by the...
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
13
by: Jim Armstrong | last post by:
Hi all - This problem has been driving me crazy, and I'm hoping the answer is something stupid I am neglecting to see.... The procedure posted below is part of an Access/SQL database I have...
7
by: creative1 | last post by:
Hello everyone. I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this. The problem is: I want to print account statement (or any other...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.