FileDatetime Doesn't Include Time If File Time Is Midnight (96098)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 2.0
- Microsoft Visual Basic Standard Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition for Windows 2.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
This article was previously published under Q96098 SUMMARY
Passing a file name with a time stamp of midnight to the function
FileDateTime, returns a string containing only the date, not the time.
This is consistent with the Format/Format$ function's General Date
format, which when passed a DateTime string with a time of midnight
returns a string containing only the date.
If your program needs to display a DateTime string with midnight
represented by 12:00 AM or 00:00 (in 24-hour format), use the Format($)
functions to perform the necessary conversion. By using Format$ or
Format with the time format symbols h, m, and s, you can cause the
Format($) functions to include a time format for midnight.
In the example below, a message box showing both the date and time of
VB.EXE, which is midnight for version 2.0, is displayed with a time stamp.
MsgBox Format$(FileDateTime("VB.EXE"), "mm/dd/yy hh:mm AMPM")
Modification Type: | Major | Last Reviewed: | 12/12/2003 |
---|
Keywords: | KB96098 |
---|
|