Function Reference


_DateTimeSplit

Split a string containing Date and Time into two separate Arrays

#include <Date.au3>
_DateTimeSplit ( $sDate, ByRef $aDatePart, ByRef $iTimePart )

Parameters

$sDate Any of these formats:
"yyyy/mm/dd[ hh:mm[:ss]]"
"yyyy/mm/dd[Thh:mm[:ss]]"
"yyyy-mm-dd[ hh:mm[:ss]]"
"yyyy-mm-dd[Thh:mm[:ss]]"
"yyyy.mm.dd[ hh:mm[:ss]]"
"yyyy.mm.dd[Thh:mm[:ss]]"
$aDatePart array that contains the Date.
$aDatePart[0] number of values returned
$iTimePart array that contains the Time.
$aTimePart[0] number of values returned

Return Value

Success: Date and Time into two separate Arrays.
Failure: 0 and sets the @error flag to non-zero.
@error: 1 - Invalid Input Date

Related

_DateAdd, _DateDiff, _DayValueToDate

Example

#include <Date.au3>
#include <MsgBoxConstants.au3>

Local $aMyDate, $aMyTime
_DateTimeSplit("2005/01/01 14:30", $aMyDate, $aMyTime)

For $x = 1 To $aMyDate[0]
    MsgBox($MB_SYSTEMMODAL, $x, $aMyDate[$x])
Next
For $x = 1 To $aMyTime[0]
    MsgBox($MB_SYSTEMMODAL, $x, $aMyTime[$x])
Next