CodeCogs - An iteractive open source Numerical library Welcome... Login
CodeCogs
shopping cart
OSXWindowsLinux
Search CodeCogs
Numerical Components

Valid RSS

UnitsDate

month

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 1.17
sub units 1.56
add a commercial licence to your cart
0
viewed 1333 times and licensed 10 times

Extracts the month from a serial Julian date. Excel: MONTH

Further Info Controller: CodeCogs  Contact Controller
+View version details
Contents hide toc
buy now     get GPL     add to cart

Interface

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

using namespace Units::Date;

int month (int nDate, calendar dateSystem=cal_Gregorian)[inline]
Extracts the month from a serial Julian date. Excel: MONTH

Function Documentation

 
intmonthintnDate
calendardateSystem = cal_Gregorian )[inline]
Returns the month of the year contained within a serial Julian date as an integer ranging from 1 to 12 (inclusive). This function uses dateYMD, to convert the serial Date into a day/ month/ year, from which the month is returned.
Example 1:
#include <stdio.h>
#include <codecogs/units/date/month.h>
using namespace Units::Date;
 
int main()
{
  printf("\n The month is %d", month(1741664));               // The month is 5
  printf("\n The month is %d", month(1741664, cal_Julian));   // The month is 6
  return 0;
}

Note:
It may be faster to simply use dateYMD, particularly if you also need the day and year from a date.
Parameters:
nDateis a serial number of days from 24 November 4714 BC (1 January 4713BC in the Julian Calendar) - also known as the Julian Period.
dateSystemselects which date system should be used (see constants):
Authors:
Will Bateman (Sep 2004)
Source Code:

To view or download source code you need either a GPL or Commercial Licence.

buy now     get GPL     add to cart

Not a member, then Register with CodeCogs. Already a Member, then Login.


Page Comments

Format Excel Equations

  You must login to leave a messge


Last Modified: 18 Oct 07 @ 17:07     Page Rendered: 2010-03-13 16:38:55

Valid CSS!   Valid XHTML 1.0 Transitional