Function Dates Times Class

DateTimeTo8CharString

"Date And Time To Eight Character String" Converts date/time value into an eight-character string that can be used as a (DOS short) file name. The range is one decade. The resolution is one minute.

Signature (Visual Basic / VBA)

Public Function DateTimeTo8CharString( _
    ByVal vDateTime As Variant _
    ) As Variant

Code Examples

    DateTimeTo8CharString(#2/13/92 13:09#) = "2B131309"
    DateTimeTo8CharString(#2/13/92 13:10#) = "2B131310"
    DateTimeTo8CharString(#5/30/94 09:30#) = "4E300930"
    DateTimeTo8CharString(#5/30/84 09:30#) = "4E300930"
    1) the last digit of the year (0..9)
    2) the month represented by a letter (A..L)
    3) the day (01..31)
    4) the hour (00..23)
    5) the minutes (00..59)

Parameters

Parameter Description
vDateTime The date/time value which is returned as an eight-character numeric string. Function returns Null if vDateTime is Null or cannot be fixed up to a Date.

Return Value

The return value is composed of: