473,799 Members | 3,209 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please help, Date Format Error

Hello,

Can someone please help me?

We have developed a asp.net application which is working fine on 4 other
computers. We have recently deplyed the application to the live environment
running windows 2000 service pack 4, .NET v1.1.

We continue to get the following error "Cast from string "18/07/2003" to
type 'Date' is not valid." as the date is dmy and not mdy. We tried to
change the server's regional settings to Australia. This did not fix the
problem. We then tried to reinstall the framework. Still no luck.

Is there some setting i have to change on the server or on the framework to
use dmy date format?

Below is an example of the asp.net source that is a corse of the problem.
Please note that it is working on other servers and the work effort to
change the code is not an option:

Public Sub deletepdf(ByVal serverpath As String)
Dim fd As System.IO.Direc toryInfo
Dim fsArray As System.IO.FileI nfo()
Dim i As Integer

fd = New System.IO.Direc toryInfo(server path + "/Temp")
fsArray = fd.GetFiles()

For i = 0 To fsArray.Length - 1
If (CDate(Format(f sArray(i).Creat ionTime, "dd/MM/yyyy")) <
CDate(Format(No w(), "dd/MM/yyyy"))) Then
fsArray(i).Dele te()
End If
Next i

End Sub

Please help me.

Regards,

Bernard.


Nov 17 '05 #1
1 3583
Hi

First use the IsDate function to determine if date can be
converted to a date or time.

Ravikanth

-----Original Message-----
Hello,

Can someone please help me?

We have developed a asp.net application which is working fine on 4 othercomputers. We have recently deplyed the application to the live environmentrunning windows 2000 service pack 4, .NET v1.1.

We continue to get the following error "Cast from string "18/07/2003" totype 'Date' is not valid." as the date is dmy and not mdy. We tried tochange the server's regional settings to Australia. This did not fix theproblem. We then tried to reinstall the framework. Still no luck.
Is there some setting i have to change on the server or on the framework touse dmy date format?

Below is an example of the asp.net source that is a corse of the problem.Please note that it is working on other servers and the work effort tochange the code is not an option:

Public Sub deletepdf(ByVal serverpath As String)
Dim fd As System.IO.Direc toryInfo
Dim fsArray As System.IO.FileI nfo()
Dim i As Integer

fd = New System.IO.Direc toryInfo(server path + "/Temp") fsArray = fd.GetFiles()

For i = 0 To fsArray.Length - 1
If (CDate(Format(f sArray (i).CreationTim e, "dd/MM/yyyy")) <CDate(Format(N ow(), "dd/MM/yyyy"))) Then
fsArray(i).Dele te()
End If
Next i

End Sub

Please help me.

Regards,

Bernard.


.

Nov 17 '05 #2

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

Similar topics

10
1658
by: Brent Webster | last post by:
This problem seems to occur dependant on the computer system settings. I have no issues when the system date is set as M/d/yyyy but I do have a problem with the system date set as d/M/yyyy. I have a text box on a web page that holds the date ie) document.frmTimesheet.tWeekFrom.value = 19/12/2004 theDate = new Date(document.frmTimesheet.tWeekFrom.value); // split into day, month, year
11
1926
by: milkyway | last post by:
Hello, I have an HTML page that I am trying to import 2 .js file (I created) into. These files are: row_functions.js and data_check_functions.js. Whenever I bring the contents of the files into this HTML file, all is OK but whenever the functions are separated (as it is now), when I run the page, I get the following error: Line 73, object expected.
6
5001
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing for long running reports. When the processing is complete it uses crystal reports to load a template file, populate it, and then export it to a PDF. It works fine so far....
22
2203
by: KitKat | last post by:
I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6, Cam 7, and Cam 8. Well it does that but it also needs to change the file name to the same folder where the file is being grabbed, BUT it doesn't. I have tried and tried.....please help example: C:\Projects\Darryl\Queue Review Files\2-24\Cam 7\Cam7-20060224170000-01.jpg Cam7 but all I keep getting is Cam1, as the beginning of the jpg name,...:( HELP!
5
2583
by: settyv | last post by:
Hi, Below is the Javascript function that am trying to call from asp:Button control. <script language="javascript"> function ValidateDate(fromDate,toDate) { var fromDate=new Date();
2
2086
by: Bill | last post by:
I have a 200 record database that includes a date/time field, AnnivDate, for a wedding anniversary. AnnivDate has nulls and some incorrect year data. I have been creating the Access database using data imported from an Excel file and the person entering into Excel only cared about the month and day portion and Excel added the current year to the field value. I want to produce a report that shows upcoming anniversaries using a parameter...
2
1463
matrekz42
by: matrekz42 | last post by:
Hello friends, I'm trying to run this Dynamic SQL in VB, but I keep getting "Compile Error" Syntax Error, in the "Bolded" area. I'm only trying to change these fields for the second query listed, should I remove the first, and repeat steps? The reason why I'm doing this, is because the table name changes from month to month. What do you Guru's recommend? Private Sub Command0_Click() ' Declare DAO Dim qdfCurr As DAO.QueryDef
1
3081
by: =?Utf-8?B?YXZucmFv?= | last post by:
We have a web service that gets data in xml format. In that Xml data, we parse few date fields that are in this format <data datefield="12/26/2008" timefield="16:33:45" ...> we parse it into a DateTime field using DateTime.Parse( datefield ).Add( TimeSpan.Parse( timefield ). For some reason, on 26th of this month from 4pm to 5pm, for certain web service calls, the date field was calculated incorrectly. Like a 12/26/2008 16:00:00 would...
3
2396
by: Lester | last post by:
I'm driving myself crazy with a problem in trying to translate a query written for Access to that for SQL server. I would think that I would use a trigger, but am not sure how to set it up. We have a database that manages bookings in four banquet halls. It was running in an Access database, but two years ago, I migrated it to SQL server. In the access database I used VBA to check to ensure no duplicate bookings. I wanted no dup...
0
10490
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10260
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10243
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9078
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7570
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.