Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AssignFile creates file with wrong date/time

Status
Not open for further replies.

pwesson

Programmer
Apr 10, 2000
95
CA
I'm using Delphi 5.0 and for some reason on one of my clients machines (WinXP Pro) the AssignFile section of my code is creating the file with the wrong date & time. It is sometimes 3 months off...

Their system clock is fine and other applications such as Word create files with the correct date and time.

DLL issue? Any thought?

Paul Wesson, Programmer/Analyst
 
Does this machine consistently create the file with the wrong date? and time? Is it always the same time behind? is it ever ahead?

From my understanding, Delphi would be calling the same low-level APIs to create the file as Word would.

As a test, add a section of code to your program that Creates a temp.txt file and simply writes DateTimeToStr(Now) to it and closes it. Then compare the file date to the date inside the file.
 
Thanks, yes I've done that. I've put some test code into my application and now just waiting to hear back from the client.

I'll post the results when I have them.

Paul Wesson, Programmer/Analyst
 
Just check out the thread a few down from here, how to add 3 months to a date (only kidding lol)
 
Problem solved!

Just goes to show you, when trying to do support never take a client at their word...

It seems the problem is that the client had their software configured in such a way that the log file I was creating was be created on a network server and that server's BIOS date/time was incorrect. This is why doing a showmessage or outputting the date in the log file was always correct, because it was the time of the local machine not the filesystem of the network computer.

Thanks to all that gave suggestions.

Paul


Paul Wesson, Programmer/Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top