<-- Previous || Up || Next -->

Parse Date Time Function
Dates Times Class

Public Function ParseDateTime( _
      ByVal vDateTime As Variant _
    , ByVal vFormat As Variant _
    ) As Variant

Uses a date/time Format to parse the date and/or time components from a String, then returns the value as a date/time.

Examples:
    ParseDateTime("20561023", "yyyymmdd") = #10/23/2056#
    ParseDateTime("130545", "hhnnss") = #13:05:45#
    ParseDateTime("1305", "hhnn") = #13:05:00#
    ParseDateTime("03:45:29 07/08/95", "hh nn ss mm dd yy") = #7/8/95 3:45:29#
See also:
    CDate Function (Visual Basic)
    CVDate Function (Visual Basic)
    Format Function (Visual Basic)
vDateTime: The string whose individual parts are interpreted as the components of a date and/or time value according to the format provided in vFormat. Function returns Null if vDate is Null or cannot be fixed up to a String.
vFormat: The string containing the format specification describing the relative placement of the date or time components within string vDateTime. Function returns Null if vFormat is Null or cannot be fixed up to a String. Each of the characters within this string describes the date or time component which should be found at the corresponding position within string vDateTime.
Format Codes:
    Y:  Year
    M:  Month
    D:  Day
    H:  Hour
    N:  Minute
    S:  Second
Return value: The function must find year, month, and day components for it to return a date value. If the function finds valid hour, minute, OR seconds components, it will return a date which has a time component.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.