Time Stamps Rendered by CMD.exe
-
Thanks for the article citation. Nevertheless, since Windows has the transition date tables mentioned in the article, and NTFS stores UTC times on disk, I see no reason that it shouldn't be fixed, even if doing so required a new switch. After all, said switch could be set in the DIRCMD environment variable.
David A. Gray Delivering Solutions for the Ages, One Problem at a Time Interpreting the Fundamental Principle of Tabular Reporting
-
Thanks for the article citation. Nevertheless, since Windows has the transition date tables mentioned in the article, and NTFS stores UTC times on disk, I see no reason that it shouldn't be fixed, even if doing so required a new switch. After all, said switch could be set in the DIRCMD environment variable.
David A. Gray Delivering Solutions for the Ages, One Problem at a Time Interpreting the Fundamental Principle of Tabular Reporting
Like the Unix linefeed mode support in Notepad that will be introduced after 30 years with the next Windows 10 version? That will be enabled by default but can be disabled with a registry key.
-
I have conclusive proof of something that I have long suspected; file times for files that fall outside the current DST/Standard time period are reported off by 1 hour by the Windows command prompt (CMD.exe). I'll be publishing the proof later today.
David A. Gray Delivering Solutions for the Ages, One Problem at a Time Interpreting the Fundamental Principle of Tabular Reporting
-
Hmmmm, Looking forward to you discovering File System Tunneling[^]. Report back and let us know what you've discovered. Start your research here[^]. :-D Best Wishes, -David Delaune
Quarks, eh? ;) I didn't respond in the thread yesterday because I was using my phone to access my email, since the fiber cable to my house was down, due to a break in the last segment of the line. However, I managed to follow the link and read both articles, which were most intriguing. Eventually, I'll probably delve into it more. Meanwhile, I've run some tests in assorted scripting languages, with mixed results. So far, I've tested the
stat()
function, as implemented in Perl and PHP. Next come JavaScript, in the Node CLI, and VBScript, and, finally, PowerShell, which I anticipate will mirror the C# program that put the nail in the coffin. Now that I've learned all this, I think the resulting article will be a third installment in the Time Zone Lab series that I started a couple of years ago.David A. Gray Delivering Solutions for the Ages, One Problem at a Time Interpreting the Fundamental Principle of Tabular Reporting
-
Like the Unix linefeed mode support in Notepad that will be introduced after 30 years with the next Windows 10 version? That will be enabled by default but can be disabled with a registry key.
Keep in mind that MS just finally "discovered" Linux. ;)
David A. Gray Delivering Solutions for the Ages, One Problem at a Time Interpreting the Fundamental Principle of Tabular Reporting
-
Quarks, eh? ;) I didn't respond in the thread yesterday because I was using my phone to access my email, since the fiber cable to my house was down, due to a break in the last segment of the line. However, I managed to follow the link and read both articles, which were most intriguing. Eventually, I'll probably delve into it more. Meanwhile, I've run some tests in assorted scripting languages, with mixed results. So far, I've tested the
stat()
function, as implemented in Perl and PHP. Next come JavaScript, in the Node CLI, and VBScript, and, finally, PowerShell, which I anticipate will mirror the C# program that put the nail in the coffin. Now that I've learned all this, I think the resulting article will be a third installment in the Time Zone Lab series that I started a couple of years ago.David A. Gray Delivering Solutions for the Ages, One Problem at a Time Interpreting the Fundamental Principle of Tabular Reporting
David A. Gray wrote:
So far, I've tested the
stat()
function, as implemented in Perl and PHP. Next come JavaScript, in the Node CLI, and VBScript, and, finally, PowerShell, which I anticipate will mirror the C# program that put the nail in the coffin. Now that I've learned all this, I think the resulting article will be a third installment in the Time Zone Lab series that I started a couple of years ago.I expect that you will get the same results from Perl, PHP, Javascript, VBScript because all of those high-level languages will call into the GetFileAttributesEx Windows API to get file time stamps. The C lib function _stat() and all 32 bit variants are forwarded to GetFileAttributes The C lib function _stat64() and all 64 bit variants functions are forwarded to GetFileAttributesEx. GetFileAttributes simply forwards to GetFileAttributesEx Finally... GetFileAttributeEx calls into the NtQueryAttributesFile function[^] via a SYSCALL and then in kernelmode the request walks it's way through the filter drivers down to the filesystem driver. You are basically testing NtQueryAttributesFile function multiple times from the Thirteenth Floor. Those high level languages may format the date differently... but they are all getting the same timestamp from the filesystem layer. Best Wishes, -David Delaune
-
David A. Gray wrote:
So far, I've tested the
stat()
function, as implemented in Perl and PHP. Next come JavaScript, in the Node CLI, and VBScript, and, finally, PowerShell, which I anticipate will mirror the C# program that put the nail in the coffin. Now that I've learned all this, I think the resulting article will be a third installment in the Time Zone Lab series that I started a couple of years ago.I expect that you will get the same results from Perl, PHP, Javascript, VBScript because all of those high-level languages will call into the GetFileAttributesEx Windows API to get file time stamps. The C lib function _stat() and all 32 bit variants are forwarded to GetFileAttributes The C lib function _stat64() and all 64 bit variants functions are forwarded to GetFileAttributesEx. GetFileAttributes simply forwards to GetFileAttributesEx Finally... GetFileAttributeEx calls into the NtQueryAttributesFile function[^] via a SYSCALL and then in kernelmode the request walks it's way through the filter drivers down to the filesystem driver. You are basically testing NtQueryAttributesFile function multiple times from the Thirteenth Floor. Those high level languages may format the date differently... but they are all getting the same timestamp from the filesystem layer. Best Wishes, -David Delaune
The problem with that theory, which has already born fruit, is that all of those functions retrieve a UTC time stamp. The issue is what happens on the 12th floor when the runtime that got the ball rolling converts the returned time stamp to local time. The outcome depends on whether they take into account the actual date and the DST transition dates on either side of it. Some frameworks take the same dumb approach implemented by CMD.exe, which treats all times as if they were in the current transition (DST vs. Standard Time). So far, I've already found two other frameworks (Perl and VBScript) that take that naieve approach.
David A. Gray Delivering Solutions for the Ages, One Problem at a Time Interpreting the Fundamental Principle of Tabular Reporting
-
The problem with that theory, which has already born fruit, is that all of those functions retrieve a UTC time stamp. The issue is what happens on the 12th floor when the runtime that got the ball rolling converts the returned time stamp to local time. The outcome depends on whether they take into account the actual date and the DST transition dates on either side of it. Some frameworks take the same dumb approach implemented by CMD.exe, which treats all times as if they were in the current transition (DST vs. Standard Time). So far, I've already found two other frameworks (Perl and VBScript) that take that naieve approach.
David A. Gray Delivering Solutions for the Ages, One Problem at a Time Interpreting the Fundamental Principle of Tabular Reporting
Hi, There use to be some amazing articles on the internet back in the 1990's that had charts and listed all the differences between the programming languages and how the handle date/time conversions. I briefly searched but could not find those old articles. Even Dr. Dobbs[^] has retired. I think it's a great idea to write an article about those differences. Looking forward to reading what you come up with. Best Wishes, -David Delaune
-
I have conclusive proof of something that I have long suspected; file times for files that fall outside the current DST/Standard time period are reported off by 1 hour by the Windows command prompt (CMD.exe). I'll be publishing the proof later today.
David A. Gray Delivering Solutions for the Ages, One Problem at a Time Interpreting the Fundamental Principle of Tabular Reporting
-
I haven't gotten to PowerShell, per se. However, since it runs atop the .NET Framework, I expect it to exhibit the same (correct) behavior as my test program. Hence, between that and the fact that I seldom use PowerShell, I wasn't planning a separate evaluation of it.
David A. Gray Delivering Solutions for the Ages, One Problem at a Time Interpreting the Fundamental Principle of Tabular Reporting