source: XIOS/trunk/src/date/julian.cpp @ 489

Last change on this file since 489 was 343, checked in by ymipsl, 12 years ago

remove "date" namespace

ym

File size: 1.5 KB
Line 
1#include "julian.hpp"
2
3namespace xios
4{
5      /// ////////////////////// Définitions ////////////////////// ///
6
7      CJulianCalendar::CJulianCalendar(const StdString & dateStr)
8         : CCalendar("Julian")
9      { initializeDate(dateStr); }
10
11      CJulianCalendar::CJulianCalendar(const StdString & dateStr,const StdString & timeOriginStr)
12         : CCalendar("Julian")
13      { initializeDate(dateStr, timeOriginStr); }
14
15      CJulianCalendar::CJulianCalendar(int yr, int mth, int d,
16                                       int hr, int min, int sec)
17         : CCalendar("Julian")
18      { initializeDate(yr, mth, d, hr, min, sec) ; }
19
20      CJulianCalendar::~CJulianCalendar(void)
21      { /* Ne rien faire de plus */ }
22
23      ///--------------------------------------------------------------
24
25      int CJulianCalendar::getYearTotalLength(const CDate & date) const
26      { // Retourne la durée d'une année en seconde.
27         if (date.getYear() % 4 == 0) return (366 * 86400);
28         return (365 * 86400);
29      }
30
31      int CJulianCalendar::getMonthLength(const CDate & date) const
32      { // Retourne la durée du mois en jour.
33         if (date.getMonth() == 2)
34         {
35            if (date.getYear()%4 == 0) return 29;
36               return 28;
37         }
38         return (CCalendar::getMonthLength(date));
39      }
40
41      StdString CJulianCalendar::getType(void) const
42      { return (StdString("julian")); }
43
44      ///--------------------------------------------------------------
45} // namespace xmlioserver
Note: See TracBrowser for help on using the repository browser.