Function Reference


_DateToDayValue

Returns the day number since noon 4713 BC January 1 for a given Gregorian date

#include <Date.au3>
_DateToDayValue ( $iYear, $iMonth, $iDay )

Parameters

$iYear A valid year in format YYYY
$iMonth A valid month in format MM
$iDay A valid day in format DD

Return Value

Success: the Julian date (days since noon 4713 BC January 1)
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>

; Julian date of today.
Local $sJulDate = _DateToDayValue(@YEAR, @MON, @MDAY)
MsgBox($MB_SYSTEMMODAL, "", "Todays Julian date is: " & $sJulDate)

; 14 days ago calculation.
Local $Y, $M, $D
$sJulDate = _DayValueToDate($sJulDate - 14, $Y, $M, $D)
MsgBox($MB_SYSTEMMODAL, "", "14 days ago:" & $M & "/" & $D & "/" & $Y)