ParseDate()

Syntax

Date = ParseDate(Mask$, String$)
Description
Transforms a string date into a regular date value which then can be used by other date functions.

Parameters

Mask$ A mask string which defines how the date string is formatted. Possible tokens are:
  %yyyy: Will be replaced by the year value, on 4 digits.
  %yy: Will be replaced by the year value, on 2 digits.
  %mm: Will be replaced by the month value, on 2 digits.
  %dd: Will be replaced by the day value, on 2 digits.
  %hh: Will be replaced by the hour value, on 2 digits.
  %ii: Will be replaced by the minute value, on 2 digits.
  %ss: Will be replaced by the second value, on 2 digits.
String$ The string with the date to be parsed.

Return value

Returns the date representing the parsed string. If the input string did not match the mask then the result is -1.

Example


  Debug ParseDate("%yy/%mm/%dd", "10/01/07")     ; Returns the date value of "10/01/07"

  Debug ParseDate("%mm/%dd/%yyyy", "01/07/2010") ; Returns the date value of "01/07/2010"

See Also

Date(), FormatDate()

Supported OS

All

<- Month() - Date Index - Second() ->