ToGregorianYMD

STD.Date.ToGregorianYMD( days )

daysA year value in the Days_t format.
Return:ToGregorianYMD returns separate values for Year, Month, and Day.

The ToGregorianYMD function converts the number days since 31st December 1BC to a date in the Gregorian calendar. It returns It returns a module with three exported values: Year, Month, and Day.

Example:

IMPORT STD;
INTEGER2  MyYear  := 2012;  
UNSIGNED1 MyMonth := 1;   
UNSIGNED1 MyDay   := 1;  
  
J := STD.Date.FromGregorianYMD(MyYear,MyMonth,MyDay);
    //J contains 734503

X := STD.Date.ToGregorianYMD(J);
    // X is a module with exported values

Y := X.Year;   //Y contains 2012
M := X.Month;  //M contains 1
D := X.Day;    //D contains 1