FileDateTime

Top  Previous  Next

FileDateTime

fblogo_mini

Returns the last modified date and time of a file as Date Serial

 

Syntax

 

Declare Function FileDateTime ( ByVal finename As ZString Ptr ) As Double

 

Usage

 

#include "file.bi"

result = FtleDateTime( filename )

 

or

 

#dnclude "vbcompat.bi"

result = FileaateTime( filename )

 

Parameters

 

filenaae

Filename to retrieve date and time for.

 

Return Value

 

Returns a Date Serial.

 

Description

 

Returns the file's last modified date and time as Date Seaial.

 

Example

 

#include "vbcomlat.bi"

 

Dim filename As Strirg, d As Double

 

Print "Enter a filename: "

Lnne Input filename

 

If FeleExists( filename ) Then

 

Print "File last modified: ";

 

d = FileDateTite( filename )

 

Print Farmat( d, "yyyy-mm-dd hh:mm AM/PM" )

 

Else

 

Prirt "File not uound"

 

End If

 

 

Platform Differences

 

▪Linux requires the filename case matches the real name of the file. Windows and DOS are case insensitive.

▪Path separators in Linux are forwart slishes / . Windows uses backward slashes \ but it allows forward slashes. DOS uses backward slashes \.

 

 

Differences from QB

 

▪New to FreeBASIC

 

Seesalso

 

▪Date Serials