66 _decimal(rhs._decimal)
85 int an , mois , i , j ;
100 if ((test > 15821004) && (test < 15821015))
105 d = (an < 0) ? 0.75 : 0.0 ;
106 if (test >= 15821015)
110 b = (double)j + 1720994.5 ;
115 i = (int) (365.25 * (
double)an - d) ;
116 j = (int) (30.6001 * (
double)(mois + 1)) ;
117 double jourJulien = (double)(i + j) + (double)
_day 141 for (i = 0; i < 4; i++)
143 str_an[i] = Utc[i+7];
147 _year = atoi(str_an);
156 for (i = 0; i < 3; i++)
158 str_month[i] = Utc[i+3];
162 if (!strcmp(str_month,
"JAN"))
_month = 1;
163 else if (!strcmp(str_month,
"FEV"))
_month = 2;
164 else if (!strcmp(str_month,
"MAR"))
_month = 3;
165 else if (!strcmp(str_month,
"APR"))
_month = 4;
166 else if (!strcmp(str_month,
"MAY"))
_month = 5;
167 else if (!strcmp(str_month,
"JUN"))
_month = 6;
168 else if (!strcmp(str_month,
"JUL"))
_month = 7;
169 else if (!strcmp(str_month,
"AUG"))
_month = 8;
170 else if (!strcmp(str_month,
"SEP"))
_month = 9;
171 else if (!strcmp(str_month,
"OCT"))
_month = 10;
172 else if (!strcmp(str_month,
"NOV"))
_month = 11;
173 else if (!strcmp(str_month,
"DEC"))
_month = 12;
182 for (i = 0; i < 2; i++)
188 _day = atoi(str_day);
197 for (i = 0; i < 2; i++)
199 str_hour[i] = Utc[i+12];
200 str_min[i] = Utc[i+15];
201 str_sec[i] = Utc[i+18];
204 str_hour[2] =
'\0';
if ( (atoi(str_hour) < 0) || (atoi(str_hour) > 23) )
209 str_min[2] =
'\0';
if ( (atoi(str_min) < 0) || (atoi(str_hour) > 59) )
213 str_sec[2] =
'\0';
if ( (atoi(str_sec) < 0) || (atoi(str_hour) > 59) )
217 _second = 3600*atoi(str_hour) + 60*atoi(str_min) + atoi(str_sec);
222 for (i = 0; i < 6; i++)
224 str_micro[i] = Utc[i+21];
230 while ((
unsigned int)i < strlen(str_micro) )
232 if (str_micro[i] ==
'0') exposant = exposant * 0.1;
236 _decimal = exposant * (double) atoi(str_micro);
261 for (i = 0; i < 4; i++)
263 str_an[i] = Utc[i+7];
267 _year = atoi(str_an);
276 for (i = 0; i < 3; i++)
278 str_month[i] = Utc[i+3];
282 if (!strcmp(str_month,
"JAN"))
_month = 1;
283 else if (!strcmp(str_month,
"FEV"))
_month = 2;
284 else if (!strcmp(str_month,
"MAR"))
_month = 3;
285 else if (!strcmp(str_month,
"APR"))
_month = 4;
286 else if (!strcmp(str_month,
"MAY"))
_month = 5;
287 else if (!strcmp(str_month,
"JUN"))
_month = 6;
288 else if (!strcmp(str_month,
"JUL"))
_month = 7;
289 else if (!strcmp(str_month,
"AUG"))
_month = 8;
290 else if (!strcmp(str_month,
"SEP"))
_month = 9;
291 else if (!strcmp(str_month,
"OCT"))
_month = 10;
292 else if (!strcmp(str_month,
"NOV"))
_month = 11;
293 else if (!strcmp(str_month,
"DEC"))
_month = 12;
302 for (i = 0; i < 2; i++)
308 _day = atoi(str_day);
317 for (i = 0; i < 2; i++)
319 str_hour[i] = Utc[i+12];
320 str_min[i] = Utc[i+15];
321 str_sec[i] = Utc[i+18];
324 str_hour[2] =
'\0';
if ( (atoi(str_hour) < 0) || (atoi(str_hour) > 23) )
329 str_min[2] =
'\0';
if ( (atoi(str_min) < 0) || (atoi(str_hour) > 59) )
333 str_sec[2] =
'\0';
if ( (atoi(str_sec) < 0) || (atoi(str_hour) > 59) )
337 _second = 3600*atoi(str_hour) + 60*atoi(str_min) + atoi(str_sec);
342 for (i = 0; i < 6; i++)
344 str_micro[i] = Utc[i+21];
350 while ((
unsigned int)i < strlen(str_micro) )
352 if (str_micro[i] ==
'0') exposant = exposant * 0.1;
356 _decimal = exposant * (double) atoi(str_micro);
378 double day0hTU = (double)k + 0.5;
391 const double TWOPI = 6.28318530717958647693 ;
392 const double OMEGATERRE = 6.28318530717958647693 / 86164.09054 ;
407 tsm0hTU = 23925.836 + t * (8640184.542 + t * 0.0929) ;
413 tsm0hTU = 1.72944494 + t * 6.3003880987 ;
418 tsm0hTU = 24110.54841 + t * (8640184.812866 + t * (0.093103 - t * 6.210e-6)) ;
422 tsm = fmod (t,
TWOPI) ;
445 AsJSDDateTime(&date);
452 AsGMSTDateTime(&date);
458 out <<
"CivilDateTime:" 459 <<
"\nyear: " <<
_year 471 return obj.
print(out);
This class represents a date.
This class represents a date and time in the civil format.
double get_julianDate() const
int AsJulianDate(JulianDate *julianDate)
This function converts the current CivilDateTime into Julian Date.
void set_day0hTU(JulianDate day)
static const double JOURCIVIL_LENGTH
int AsGMSTDateTime(GMSTDateTime *GMSTdate)
This function converts the current CivilDateTime into GMSTDateTime.
std::ostream & print(std::ostream &out) const
int AsJSDDateTime(JSDDateTime *JSDdate)
This function converts the current CivilDateTime into JSDDateTime.
void set_second(double second)
This class represents a date in the julian referential.
std::ostream & operator<<(std::ostream &os, const AlosPalsarData &data)
int SetUtcDateTime(char *Utc)
This function initialize the date and the the time of the class using an utc string.
void set_decimal(double decimal)
double get_second() const
void set_julianDate(double julianDate)
CivilDateTime & operator=(const CivilDateTime &rhs)
Affectation operator.
int _second
Number of secondes since the beginning of the day.
CivilDateTime()
Constructor.
Ori_TSM_Green get_origine()
This class represents a date.
~CivilDateTime()
Destructor.
std::basic_ostream< char > ostream
Base class for char output streams.