ParseDateTime Procedure

Version 6

Converts a date/time string to a DateTime data type.

Syntax

bRet = ParseDateTime ( bsDate, pdt )

The ParseDateTime procedure syntax has the following parts:

 

Name

Type

Description

bsDate

Val BString

Date time string to be parsed - see below for details

pdt

Var DateTime

Converted to a date/time value

bRet

Val Bool

Return status True/False to indicate if successfully parsed or not

Comments

The bsDate parameter can take a variety of formats. For example, the following strings contain acceptable date/time formats:

"25 January 1996"

"8:30:00"

"20:30:00"

"January 25, 1996 8:30:00"

"8:30:00 Jan. 25, 1996"

"1/25/1996 8:30:00"  // always specify the full year, even in a 'short date' format

Example

The following will display date as in Windows Explorer:
 

! set current date/time to dtExpired

ParseDateTime(SDate()+" "+STime(), dtExpired)

See Also

FormatDateTime, SDate, STime