473,786 Members | 2,399 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File Dates - Wrong date returned

Guys,

I am reading file information from disk using the System.IO.File object.

This is what the operating system is displaying on Explorer:
File Name Modified
=============== =============== ======
File1.ext 6/19/2003 1:05 PM
File2.ext 6/14/2000 12:46 PM

This is what my program reads:
File Name Modified
=============== =============== ======
File1.ext 12/7/1999 7:00:00 AM
File2.ext 9/19/2001 1:50:25 PM

It reads wrong dates (and the same) with all 3 methods:
File.GetCreatio nTime(FilePath)
File.GetLastAcc essTime(FilePat h)
File.GetLastWri teTime(FilePath )
(All 3 methods return the same date)

What am I doing wrong????

Is there any work I have to do on the dates to get this to work?
I am Eastern Time Zone by the way.

Thanks!
Nov 20 '05 #1
1 2341
Hi, Juan

Post a piece of code which you use to obtain modification timestamp from
file and to print it. Either something is not right there, either you are
getting wrong files (another directory maybe?).

HTH
Alex

"Juan Romero" <ju*********@bo wne.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Guys,

I am reading file information from disk using the System.IO.File object.

This is what the operating system is displaying on Explorer:
File Name Modified
=============== =============== ======
File1.ext 6/19/2003 1:05 PM
File2.ext 6/14/2000 12:46 PM

This is what my program reads:
File Name Modified
=============== =============== ======
File1.ext 12/7/1999 7:00:00 AM
File2.ext 9/19/2001 1:50:25 PM

It reads wrong dates (and the same) with all 3 methods:
File.GetCreatio nTime(FilePath)
File.GetLastAcc essTime(FilePat h)
File.GetLastWri teTime(FilePath )
(All 3 methods return the same date)

What am I doing wrong????

Is there any work I have to do on the dates to get this to work?
I am Eastern Time Zone by the way.

Thanks!

Nov 20 '05 #2

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

Similar topics

11
2861
by: Peter Pfeiffer | last post by:
I've written several scripts that have "while" blocks which increment a date by one day if the date does not match one of a group of dates. However, sometimes it apparently steps out out the while loop even though my condition isn't met. Will work for a few loops then steps out often. Are there javascript "date" issues? I have also noticed different results between Firefox and Internet Explorer. thanks for any comments,
52
4599
by: Andy Dingley | last post by:
I'm using this at present: <p title="Publication date" ></p> Works fine on screen, but Fangs/Jaws just reads it as "left bracket twenty-eight slash zero slash two thousand five fifteen colon zero right bracket" Really it needs something more to indicate that it _is_ a date. The brackets would be better done with CSS, :before and content: , but the boss wants it to work under IE too. The site is firmly UK
36
2079
by: Lindie | last post by:
The more I read the more confused I get. Too much on dates calulations in the groups. I need to know how often a book has been loaned out over the past year- 52 weeks. My table has Book DateOut Total
8
14978
by: Notgiven | last post by:
Say you have two dates, 2005-01-01 and 2005-01-24. I want to get a list or array or all the date between and including those two dates. I want to include this list in a query so I need it in a format like: '2005-01-01', '2005-01-02',... Any ideas? thanks
12
2443
by: Dixie | last post by:
I am trying to calculate the number of workdays between two dates with regards to holidays as well. I have used Arvin Meyer's code on the Access Web, but as I am in Australia and my date format is dd/mm/yyyy, I have found that the dates I put in my holidays table are reversed into American dates. So, the wrong holiday dates are subtracted from the total workdays between the start and end dates. Is there an easy fix for this? ******Code...
5
5163
by: DW | last post by:
I have a query in Access 2003 that has the following criteria SELECT tblOrder.SessionDate, tblMenus.Item_Name, tblOrder.Type, Format$(tblorder!SessionDate,"Short Time") AS SessionTime, Sum(tblMenus.Item_Quantity) AS MenuCount INTO tblSessionQuery FROM tblOrder, tblMenus WHERE (((tblOrder.Order_ID)=.) AND ((Format$(!,"mm/dd/yyyy")) Between Format$(!!,"mm/dd/yyyy") And Format$(!!,"mm/dd/yyyy")))
3
9559
by: Chung Leong | last post by:
Here's the rest of the tutorial I started earlier: Aside from text within a document, Indexing Service let you search on meta information stored in the files. For example, MusicArtist and MusicAlbum let you find MP3 and other music files based on the singer and album name; DocAuthor let you find Office documents created by a certain user; DocAppName let you find files of a particular program, and so on. Indexing Service uses plug-ins...
14
3497
by: MLH | last post by:
After entering a date (earlier than today's date) into a textbox control though, I'm stumped as to why VBA thinks date I enter into the control is greater than Now - when they are CLEARLY less than Now. Here's the code I have in the AfterUpdate event. I must be overlooking the obvious. Ideas? Private Sub DateSigned_AfterUpdate() If Me!DateSigned Now Then Me!DateSigned = Null
0
1467
by: =?Utf-8?B?QnJ5YW4=?= | last post by:
Hello group. I've migrated from Win 2003 server to Win 2008 server. I've been banging my head agaist a wall for several days now trying to figure this out. I have the following script that will search the file system and return file names of all files within a folder and subfolders that meet the search criteria of DateLastModified. To test the output, you can use the following link:
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9492
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10360
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
10163
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...
0
9960
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
8988
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
7510
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
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.