Skip to content

Modern Fs FileInfo CreatedUtc

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Filesystem › Filesystem Library › FileInfo.CreatedUtc

FileInfo.CreatedUtc

Returns the creation time in ticks, or 0 when HasCreated is false.

Syntax

FileInfo.CreatedUtc( )

Examples

#import "std/fs"
using fs

dim td as FsResultUStr = CreateTempDir( "fbdoc" )
dim as ustring dir_ = td.Value( )
dim as ustring p = PathJoin( dir_, "f.txt" )
WriteAllText( p, "hello" )

dim info as FileInfo = Stat( p ).Value( )

'' NOT EVERY PLATFORM HAS ONE. Check HasCreated before reading it, or a
'' zero from a filesystem that does not record creation looks like
'' 0001-01-01.
if info.HasCreated( ) then
    print info.CreatedUtc( ) > 0         '' -1 (true) on Windows
end if
print info.HasCreated( )                 '' true on Windows

RemoveDirAll( dir_ )

Library: Filesystem Library
Category: Filesystem
Documented under: Metadata

Clone this wiki locally