473,326 Members | 2,110 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.

How to get a file's date/time correctly?

Hi, friends,

I use the following C# code to find out date/time for all files in a
directory: (Those files are retrieved from VSS).

VSS_Item.Get(ref tempFile, (int) SourceSafeTypeLib.VSSFlags.VSSFLAG_TIMEMOD);
if (File.Exists(tempFile))
FileDate = File.GetLastWriteTime(tempFile).ToString();

However, some of FileDate values are the same as shown in window Exploer and
VSS, some of them are 1 hour later.

Could anyone show me why and how to correct this?

Thanks a lot.

Nov 16 '05 #1
2 6892
Could it be a daylight savings adjustment (or lack thereof)?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Tue, 7 Dec 2004 08:09:06 -0800, Andrew
<An****@discussions.microsoft.com> wrote:
Hi, friends,

I use the following C# code to find out date/time for all files in a
directory: (Those files are retrieved from VSS).

VSS_Item.Get(ref tempFile, (int) SourceSafeTypeLib.VSSFlags.VSSFLAG_TIMEMOD);
if (File.Exists(tempFile))
FileDate = File.GetLastWriteTime(tempFile).ToString();

However, some of FileDate values are the same as shown in window Exploer and
VSS, some of them are 1 hour later.

Could anyone show me why and how to correct this?

Thanks a lot.


Nov 16 '05 #2
Possible, but some of file date/time are correct...

"Scott Allen" wrote:
Could it be a daylight savings adjustment (or lack thereof)?

--
Scott
http://www.OdeToCode.com/blogs/scott/


Nov 16 '05 #3

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

Similar topics

5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
3
by: Jay | last post by:
I previously posted this question under Visual Basic newsgroup, but was advised to re-post here. I'm hoping someone can help me solve an issue I'm having with VB.Net and Access 2000. Here's...
15
by: Simon Brooke | last post by:
I'm investigating a bug a customer has reported in our database abstraction layer, and it's making me very unhappy. Brief summary: I have a database abstraction layer which is intended to...
11
by: lduperval | last post by:
Hi, I`m trying to do date calculations in three types of time zones: local, GMT and specified. The issue I am facing is that I need to be able to specify a date in the proper time zone, and I`m...
10
by: Wes Johnson | last post by:
I've encountered a problem where I am changing a particular c source document and then running the associated make command in the console. If I then run that program, it is as though the update has...
0
by: tohear | last post by:
ToOADate and FromOADate don't handle negative dates with time parts correctly. Negative dates with no time parts are OK. (Note: In COM date "zero" is 12/30/1899). Does anyone know if these are...
6
by: Scott | last post by:
I have a start date and an end date in my project that is defaulted to the current date at run-time using the following code... Date1.Value = Now() Date2.Value = Now() I then have some code...
1
by: Tim Failes | last post by:
This seems a trival question, but I cannot get it to work properly... Essentially my question is, how can I create a text file, and guarantee it is given the current date/time as the Creation Time?...
13
by: maflatoun | last post by:
Hi, I have the following function to convert UTC time to Local time. It works perfect for GMT- (Minus) time zones however it provides incorrect results for GMT+(Plus) time zones? // Format to...
27
by: Jeff | last post by:
Im trying to figure out why I cant read back a binary file correctly. I have the following union: #define BITE_RECORD_LEN 12 typedef union { unsigned char byte; struct { unsigned char type;...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.