Function Reference


_DayValueToDate

Add the given days since noon 4713 BC January 1 and returns the Gregorian date

#include <Date.au3>
_DayValueToDate ( $iJulianDate, ByRef $iYear, ByRef $iMonth, ByRef $iDay )

Parameters

$iJulianDate A valid number of days.
$iYear will return the year in format YYYY
$iMonth will return the month in format MM
$iDay will return the day in format DD

Return Value

Success: the date calculated.
Failure: 0 and sets the @error flag to non-zero.
@error: 1 - Invalid Input number of days.

Related

_DateAdd, _DateDiff, _DateTimeSplit, _DateToDayOfWeek, _DateToDayOfWeekISO, _DateToDayValue

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 & "  (" & $sJulDate & ")")