Extracts the day from a serial Julian date. <span align="right" style="background-color:99FF99"><strong>Excel: DAY</strong></span>

You're viewing an older version of this page (#195). View the current version.

View versions (1)

Interface

#include <codecogs/units/date/day.h>

using namespace Units::Date;

Returns the day of the month contained within nDate, as an integer ranging from 1 to 31 (inclusive).

Example 1

#include <stdio.h>
#include <codecogs/units/date/day.h>
using namespace Units::Date;

int main()
{
  printf("\n The day is %d", day(1741667));              // The day is 2
  printf("\n The day is %d", day(1741667, cal_Julian));  // The day is 4
  return 0;
}

Parameters

nDate
is a serial number of days from 24 November 4714 BC (1 January 4713BC in the Julian Calendar) - also known as the Julian Period.
dateSystem
selects which date system should be used (see constants):
Blank
  • cal_Gregorian (default)
  • cal_Julian
  • cal_Excel (same as Gregorian)

It may be faster to simply use dateYMD if you also need the year and month from a same serial Julian date.

GPL Licence — free for non commercial use. See Licence details.