WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Time - Timer and Date Functions
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

FileTimeSetEx January 1 1908

 Keywords: FileTimeGet FileTimeSet FileTimeSetEx FileTimeGetEx YMDHMS Epoch Jan January 1 first 1980

Question:

i'm having trouble with FileTimeSetEx (wil interpreter 4.0). i set both the #1 and #2 times for the file to 1955:06:15:12:00:00. then i test the #1 time using FileTimeGetEx. i get: 1980:01:01:00:00:00!=1955:06:15:12:00:00

in explorer, details view, the file shows up with a blank for the 'date modified'. but if i right click on the file, the properties show the #1 and #2 times to be 1955:06:15:12:00:00.

what the heck is going on?

code fragment: time = StrCat(year, ':', issue, ":15:12:00:00") Display(.1, file, time) for j = 1 to 2 FileTimeSetEx(article, time, j) endfor Delay(.5) articleTime = FileTimeGetEx(article, 1) if (articleTime!=time) ClipPut(StrCat(articleTime, "!=", time)) AskYesNo(file, StrCat(articleTime, "!=", time)) endif

Answer:

Ah yes, in computer science and computer programming, system time represents a computer system's notion of the passing of time. In this sense, time also includes the passing of days on the calendar. System time is measured by a system clock, which is typically implemented as a simple count of the number of ticks that have transpired since some arbitrary starting date, called the epoch.
Epoch dates in computing
---------------------------
NTFS, COBOL, Win32/Win64 - January 1, 1601 DOS, OS/2, FAT16 and FAT32 filesystem - January 1, 1980
http://en.wikipedia.org/wiki/Epoch_(reference_date)

http://en.wikipedia.org/wiki/System_time

Hopefully this help explain why you cannot get or set the file timestamp to a value older than January 1 1980 on a FAT32 file system.


Article ID:   W18300
Filename:   FileTimeSetEx January 1 1980.txt
File Created: 2010:05:10:10:56:10
Last Updated: 2010:05:10:10:56:10