Returns the current date as a serial Julian date. <span align="right" style="background-color:99FF99"><strong>Excel: TODAY</strong></span>

View versions (1)

Interface

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

using namespace Units::Date;

Returns the current date as a serial Julian date; the number of days since 24 November 4714BC (in the Gregorian calendar).

Example 1

To output todays date in the Gregorian and Julian calendars

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

int main()
{
  int d,m,y;
  dateYMD(today(), y,m,d);
  printf("\n The Gregorian date is: %d/%d/%d", d,m,y);
  dateYMD(today(), y,m,d, cal_Julian);
  printf("\n The Julian date is: %d/%d/%d", d,m,y);
  return 0;
}
GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

Result