Logo coherent WaveBurst  
Library Reference Guide
Logo
time.cc
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Gabriele Vedovato
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 #include "time.hh"
20 #include "TMath.h"
21 
22 #define CWB_MJD_REF 2400000.5 // Reference Julian Day for Mean Julian Day
23 
24 ClassImp(wat::Time) // used by THtml doc
25 
26 using namespace wat;
27 
28 /* :TODO: this Time class is used in many place where seconds are INT_4U.
29  Perhaps I should rename this class OffsetTime and write another called Time,
30  where seconds are unsigned */
31 
32 //-----------------------------------------------------------------------------
33 // Constructors
34 //-----------------------------------------------------------------------------
35 
36 
37 //-----------------------------------------------------------------------------
38 //
39 // Constructor.
40 //
41 // param: INT_4S sec - number of seconds. Default: 0
42 // param: INT_4U nsec - number of nanoseconds. Default: 0
43 
44 wat::Time::Time(INT_4S sec, INT_4U nsec) : mSec(sec), mNSec(nsec) {
45 
46  tzset();
47  setenv("TZ", ":UTC", 1);
48 
49  if ( mNSec >= 1000000000 ) {
50  mSec += INT_4S( mNSec / 1000000000 );
51  mNSec = mNSec % 1000000000;
52  }
53 }
54 
55 //: uct from Double conversion AC
56 wat::Time::Time(double dtime) : mSec(0), mNSec(0) {
57 
58  tzset();
59  setenv("TZ", ":UTC", 1);
60 
61  SetDouble(dtime);
62 }
63 
64 //-----------------------------------------------------------------------------
65 // Copy Constructor.
66 // param: Time& time -
67 
68 wat::Time::Time(Time& time) : mSec(time.GetSec()), mNSec(time.GetNSec()) {
69  tzset();
70  setenv("TZ", ":UTC", 1);
71 }
72 
73 //-----------------------------------------------------------------------------
74 // Operator Overloads
75 //-----------------------------------------------------------------------------
76 
77 //-----------------------------------------------------------------------------
78 // Assignment Operator.
79 // param: Time& time -
80 // return: Time&
81 // exc: bad_alloc - Memory allocation failed.
82 
84 
85  if ( this != &time ) {
86  mSec = time.GetSec();
87  mNSec = time.GetNSec();
88  }
89  return *this;
90 }
91 
92 
93 //-----------------------------------------------------------------------------
94 // Addition & assignment.
95 // param: Time& time -
96 // return: Time& time -
97 
99 
100  mSec += time.GetSec();
101  mNSec += time.GetNSec();
102  if ( mNSec >= 1000000000 ) {
103  mSec += INT_4S( mNSec / 1000000000 );
104  mNSec = mNSec % 1000000000;
105  }
106  return *this;
107 }
108 
109 
110 //-----------------------------------------------------------------------------
111 // Subtraction and assignment.
112 // param: Time& time -
113 // return: Time& time -
114 
116 
117  mSec -= time.GetSec();
118  if ( mNSec >= time.GetNSec() ) {
119  mNSec -= time.GetNSec();
120  } else {
121  --mSec;
122  mNSec += 1000000000 - time.GetNSec();
123  }
124  return *this;
125 }
126 
127 //-----------------------------------------------------------------------------
128 // Multiplication and assignment.
129 // param: double& d -
130 // return: Time& time -
131 // todo: What happens if d is negative?
132 
134 
135  unsigned long long tmp = d*1000000000;
136  unsigned long long lsec1 = d;
137  unsigned long long lnsec1 = (tmp%1000000000)/100;
138  unsigned long long lsec2 = mSec;
139  unsigned long long lnsec2 = mNSec/100;
140 
141  tmp = lsec1*lsec2*1000000000+(lsec1*lnsec2+lnsec1*lsec2)*100+(lnsec1*lnsec2)/100000;
142 
143  mSec = tmp/1000000000;
144  mNSec = tmp%1000000000;
145 
146  return *this;
147 }
148 
149 //-----------------------------------------------------------------------------
150 // Division and assignment.
151 // param: double& d -
152 // return: Time& time -
153 // todo: What happens if d is negative?
154 
156 
157  double ns = mNSec / d;
158  double s = mSec / d;
159  mSec = INT_4S( mSec / d );
160  mNSec = (INT_4U)( ns+(s-mSec)*1000000000 );
161  return *this;
162 }
163 
164 //-----------------------------------------------------------------------------
165 // Division.
166 // param: Time& time -
167 // return: double -
168 
169 double wat::Time::operator/(Time& time) {
170 
171  return ((1000000000*mSec+mNSec)
172  /(1000000000*time.GetSec()+time.GetNSec()));
173 }
174 
175 //-----------------------------------------------------------------------------
176 // Equal comparison.
177 // Determines whether two Time objects are equal.
178 // param: Time& time - The object to compare with.
179 // return: bool - true if the objects are equal.
180 
182  return (mSec==time.GetSec())&&(mNSec==time.GetNSec());
183 }
184 
185 //-----------------------------------------------------------------------------
186 // Less than or equal to comparison.
187 // param: Time& time - The object to compare with.
188 // return: bool -
189 
191  return !( *this > time );
192 }
193 
194 //-----------------------------------------------------------------------------
195 // Greater than or equal to comparison.
196 // param: Time& time - The object to compare with.
197 // return: bool -
198 
200  return !( *this < time );
201 }
202 
203 //-----------------------------------------------------------------------------
204 // Not equal comparison.
205 // param: Time& time - The object to compare with.
206 // return: bool -
207 
209  return !( *this == time );
210 }
211 
212 //-----------------------------------------------------------------------------
213 // Less than comparison.
214 // param: Time& time - The object to compare with.
215 // return: bool -
216 
218 
219  if ( mSec != time.GetSec() ) {
220  return ( mSec < time.GetSec() );
221  } else {
222  return ( mNSec < time.GetNSec() );
223  }
224 }
225 
226 //-----------------------------------------------------------------------------
227 // Greater than comparison.
228 // param: Time& time - The object to compare with.
229 // return: bool -
230 
232 
233  if (mSec != time.GetSec()) {
234  return ( mSec > time.GetSec() );
235  } else {
236  return ( mNSec > time.GetNSec() );
237  }
238 }
239 
240 //-----------------------------------------------------------------------------
241 // Addition.
242 // param: Time& t1
243 // param: Time& t2
244 // return: Time -
245 
247 
248  Time t3( t1 );
249  return ( t3 += t2 );
250 }
251 
252 //-----------------------------------------------------------------------------
253 // Subtraction.
254 // param: Time& t1
255 // param: Time& t2
256 // return: Time -
257 
259  Time t3( t1 );
260  return ( t3 -= t2 );
261 }
262 
263 //-----------------------------------------------------------------------------
264 // Multiplication.
265 // param: Time& t
266 // param: double& d
267 // return: Time -
268 
269 Time wat::operator*(Time& t, double& d) {
270  Time t3( t );
271  return ( t3 *= d );
272 }
273 
274 //-----------------------------------------------------------------------------
275 // Division.
276 // param: Time& t
277 // param: double& d
278 // return: Time -
279 
280 Time wat::operator/(Time& t, double& d) {
281  Time t3( t );
282  return ( t3 /= d );
283 }
284 
285 //-----------------------------------------------------------------------------
286 // Multiplication.
287 // param: double& d
288 // param: Time& t
289 // return: Time -
290 
291 Time wat::operator*(double& d, Time& t) {
292  Time t3( t );
293  return ( t3 *= d );
294 }
295 
296 //-----------------------------------------------------------------------------
297 // Input extraction operator.
298 // param: Input& in
299 // param: Time& time
300 // return: Input&
301 // exc: read_failure
302 
303 istream& wat::operator>>(istream& in, Time& time) {
304  in >> time.mSec >> time.mNSec;
305  return in;
306 }
307 
308 //-----------------------------------------------------------------------------
309 // Double conversion operators (AC)
310 
311 void wat::Time::SetDouble(double dt) {
312 
313  mSec = dt;
314  unsigned long long tmp = dt*1000000000;
315  mNSec = (tmp%1000000000);
316 }
317 
318 //-----------------------------------------------------------------------------
319 
321 
322  double dt;
323  dt = mSec + 1.e-9 * mNSec;
324  return dt;
325 }
326 
327 //-----------------------------------------------------------------------------
328 // Set Date String
329 // Date Format : XXYY-MM-DD hh:mm:ss
330 
332 
333  date.ToLower();
334 
335  if (date.CompareTo("now")==0) { // set current date
336  time_t ticks = time(NULL);
337  this->SetSec(mktime(gmtime(&ticks)));
338  this->SetNSec(0);
339  this->UnixToGps();
340  return;
341  }
342 
343  date.Resize(19);
344 
345  // if date string is compatible with a integer it is converted to date
346  if (date.IsDigit()) {this->SetSec(date.Atoi());return;}
347 
348  TString idate;
349  if (date.Sizeof()==20) { // "XXYY-MM-DD hh:mm:ss" -> "ss:mm:hh-DD:MM:YY"
350  int xx = TString(date(0,2)).Atoi();
351  int yy = TString(date(2,2)).Atoi();
352  if (yy>=80) if(xx!=19) {
353  char msg[256];
354  sprintf(msg,"error in data format : %s [Year >= 1980 && <2079]",date.Data());
355  Error(msg);
356  }
357  if (yy<80) if(xx!=20) {
358  char msg[256];
359  sprintf(msg,"error in data format : %s [Year >= 1980 && <2079]",date.Data());
360  Error(msg);
361  }
362  idate = date(17,2)+":"+date(14,2)+":"+date(11,2)+"-"+date(8,2)+":"+date(5,2)+":"+date(2,2);
363  } else {
364  idate = date;
365  }
366  SetString(const_cast<char*>(idate.Data()));
367 }
368 
369 //-----------------------------------------------------------------------------
370 // Set Date String
371 // Date Format : ss:mm:hh:DD:MM:YY
372 
373 void wat::Time::SetString(char* date, int nsec) {
374 
375  char DD_s[4],MM_s[4],YY_s[4],hh_s[4],mm_s[4],ss_s[4];
376  int DD,MM,YY,hh,mm,ss;
377 
378  if (strlen(date) != 17) Error(const_cast<char*>("date length not valid"));
379 
380  strncpy(ss_s,date,2);
381  if(!isdigit(ss_s[0])) Error(const_cast<char*>("sec not valid format"));
382  if(!isdigit(ss_s[1])) Error(const_cast<char*>("sec not valid format"));
383  ss_s[2]=0;
384  ss=atoi(ss_s);
385 
386  strncpy(mm_s,date+3,2);
387  if(!isdigit(mm_s[0])) Error(const_cast<char*>("minutes not valid format"));
388  if(!isdigit(mm_s[1])) Error(const_cast<char*>("minutes not valid format"));
389  mm_s[2]=0;
390  mm=atoi(mm_s);
391 
392  strncpy(hh_s,date+6,2);
393  if(!isdigit(hh_s[0])) Error(const_cast<char*>("hour not valid format"));
394  if(!isdigit(hh_s[1])) Error(const_cast<char*>("hour not valid format"));
395  hh_s[2]=0;
396  hh=atoi(hh_s);
397 
398  strncpy(DD_s,date+9,2);
399  if(!isdigit(DD_s[0])) Error(const_cast<char*>("day not valid format"));
400  if(!isdigit(DD_s[1])) Error(const_cast<char*>("day not valid format"));
401  DD_s[2]=0;
402  DD=atoi(DD_s);
403 
404  strncpy(MM_s,date+12,2);
405  if(!isdigit(MM_s[0])) Error(const_cast<char*>("month not valid format"));
406  if(!isdigit(MM_s[1])) Error(const_cast<char*>("month not valid format"));
407  MM_s[2]=0;
408  MM=atoi(MM_s);
409 
410  strncpy(YY_s,date+15,2);
411  if(!isdigit(YY_s[0])) Error(const_cast<char*>("year not valid format"));
412  if(!isdigit(YY_s[1])) Error(const_cast<char*>("year not valid format"));
413  YY_s[2]=0;
414  YY=atoi(YY_s);
415  if (YY<70) YY+=100;
416 
417  SetDate(ss,mm,hh,DD,MM,YY,nsec);
418 }
419 
420 void wat::Time::SetDate(int ss, int mm, int hh, int DD, int MM, int YY, int nsec) {
421 
422  // the values must be checked !!!!!!!!! -> to be done
423 
424  if(YY>1900) YY-=1900;
425 
426  // extern char *tzname[2];
427  struct tm in_tp;
428 
429  in_tp.tm_sec = ss; // seconds 0:59
430  in_tp.tm_min = mm; // minutes 0:59
431  in_tp.tm_hour = hh; // hours 0:23
432  in_tp.tm_mday = DD; // day of the month 1:31
433  in_tp.tm_mon = MM-1; // month 0:11
434  in_tp.tm_year = YY; // year since 1900
435  in_tp.tm_isdst= 0;
436 
437  tzset();
438  setenv("TZ", ":UTC", 1);
439 
440  time_t in_utc_sec = mktime(&in_tp);
441  struct tm* out_tp = gmtime(&in_utc_sec);
442  time_t out_utc_sec = mktime(out_tp);
443 
444  // setenv("TZ", *tzname, 1);
445 
446  if (in_tp.tm_sec != ss) Error(const_cast<char*>("sec not valid format"));
447  if (in_tp.tm_min != mm) Error(const_cast<char*>("minutes not valid format"));
448  if (in_tp.tm_hour != hh) Error(const_cast<char*>("hour not valid format"));
449  if (in_tp.tm_mday != DD) Error(const_cast<char*>("day not valid format"));
450  if (in_tp.tm_mon != MM-1) Error(const_cast<char*>("month not valid format"));
451  if (in_tp.tm_year != YY) Error(const_cast<char*>("year not valid format"));
452 
453  if(in_utc_sec != out_utc_sec) Error(const_cast<char*>("Date not valid format"));
454 
455  mSec = in_utc_sec; // - UTC_UNIX_SPAN - UTC_LEAP_SECONDS;
456  mNSec = nsec;
457 
458  UnixToGps();
459 };
460 
462 
463  Time tempTime(*this);
464  tempTime.GpsToUnix();
465  time_t time = tempTime.GetSec();
466 
467  bool leap=false;
468  for(int i=0;i<GPS_LEAPS_TABLE_SIZE;i++)
469  if(gps_leaps_table[i].gps==GetSec()+1) {time-=1;leap=true;break;}
470 
471  // Convert Data Format
472  // From
473  // Thu Feb 5 05:30:34 1981
474  // To
475  // 1981-02-05 05:30:34 UTC Thu
476 
477  TObjArray* token = TString(ctime(&time)).Tokenize(TString(' '));
478  TObjString* week_tok = (TObjString*)token->At(0);
479  TString week = week_tok->GetString();
480  TObjString* month_tok = (TObjString*)token->At(1);
481  TString month = month_tok->GetString();
482  TObjString* day_tok = (TObjString*)token->At(2);
483  TString day = day_tok->GetString();
484  TObjString* hhmmss_tok = (TObjString*)token->At(3);
485  TString hhmmss = hhmmss_tok->GetString();
486  if(leap) {hhmmss[6]='6';hhmmss[7]='0';}
487  TObjString* year_tok = (TObjString*)token->At(4);
488  TString year = year_tok->GetString();
489  year.Resize(year.Sizeof()-2);
490 
491  if(month.CompareTo("Jan")==0) month="01";
492  if(month.CompareTo("Feb")==0) month="02";
493  if(month.CompareTo("Mar")==0) month="03";
494  if(month.CompareTo("Apr")==0) month="04";
495  if(month.CompareTo("May")==0) month="05";
496  if(month.CompareTo("Jun")==0) month="06";
497  if(month.CompareTo("Jul")==0) month="07";
498  if(month.CompareTo("Aug")==0) month="08";
499  if(month.CompareTo("Sep")==0) month="09";
500  if(month.CompareTo("Oct")==0) month="10";
501  if(month.CompareTo("Nov")==0) month="11";
502  if(month.CompareTo("Dec")==0) month="12";
503 
504  char date[256];
505  // 1981-02-05 05:30:34 UTC Thu
506  sprintf(date,"%s-%s-%02d %s UTC %s",year.Data(),month.Data(),day.Atoi(),hhmmss.Data(),week.Data());
507 
508  return date;
509 }
510 
512 /*
513  char time_str[26];
514  Time tempTime(*this);
515  tempTime.GpsToUnix();
516  time_t time = tempTime.GetSec();
517  strcpy(time_str, ctime(&time));
518  cout << time_str << endl;
519 */
520  cout << GetDateString().Data() << endl;
521 }
522 
524 //
525 // From LAL XLALCivilTime.c
526 //
527 // Returns the Julian Date (JD)
528 //
529 // See ref esaa1992 and ref green1985 for details. First, some
530 // definitions:
531 //
532 // Mean Julian Year = 365.25 days
533 // Julian Epoch = 1 Jan 4713BCE, 12:00 GMT (4713 BC Jan 01d.5 GMT)
534 // Fundamental Epoch J2000.0 = 2001-01-01.5 TDB
535 //
536 // Julian Date is the amount of time elapsed since the Julian Epoch,
537 // measured in days and fractions of a day. There are a couple of
538 // complications arising from the length of a year: the Tropical Year is
539 // 365.2422 days. First, the Gregorian correction where 10 days
540 // (1582-10-05 through 1582-10-14) were eliminated. Second, leap years:
541 // years ending with two zeroes (e.g., 1700, 1800) are leap only if
542 // divisible by 400; so, 400 civil years contain 400 * 365.25 - 3 = 146097
543 // days. So, the Julian Date of J2000.0 is JD 2451545.0, and thus the
544 // Julian Epoch = J2000.0 + (JD - 2451545) / 365.25, i.e., number of years
545 // elapsed since J2000.0.
546 //
547 // One algorithm for computing the Julian Day is from ref vfp1979 based
548 // on a formula in ref esaa1992 where the algorithm is due to
549 // fvf1968 and ``compactified'' by P. M. Muller and R. N. Wimberly.
550 // The formula is
551 //
552 // \f[
553 // jd = 367 \times y - 7 \times (y + (m + 9)/12)/4 - 3 \times ((y + (m -
554 // 9)/7)/100 + 1)/4 + 275 \times m/9 + d + 1721029
555 // \f]
556 //
557 // where jd is the Julian day number, y is the year, m is the month (1-12),
558 // and d is the day (1-31). This formula is valid only for JD > 0, i.e.,
559 // after -4713 Nov 23 = 4712 BCE Nov 23.
560 //
561 // A shorter formula from the same reference, but which only works for
562 // dates since 1900 March is:
563 //
564 // \f[
565 // jd = 367 \times y - 7 \times (y + (m + 9)/12)/4 + 275 \times m/9 + d +
566 // 1721014
567 // \f]
568 //
569 // We will use this shorter formula since there is unlikely to be any
570 // analyzable data from before 1900 March.
571 //
572 
573  const int sec_per_day = 60 * 60 * 24; // seconds in a day
574  int year, month, day, sec;
575  double jd;
576 
577  // this routine only works for dates after 1900
578  if(GetYear()<=0) Error(const_cast<char*>("Year must be after 1900"));
579 
580  year = GetYear();
581  month = GetMonth(); // month is in range 1-12
582  day = GetDay(); // day is in range 1-31
583  sec = GetSecond() + 60*(GetMinute() + 60*GetHour()); // seconds since midnight
584 
585  jd = 367*year - 7*(year + (month + 9)/12)/4 + 275*month/9 + day + 1721014;
586  // note: Julian days start at noon: subtract half a day
587  jd += (double)sec/(double)sec_per_day - 0.5;
588  return jd;
589 }
590 
592 //
593 // From LAL XLALCivilTime.c
594 //
595 // Returns the Modified Julian Day (MJD)
596 //
597 // Note:
598 // - By convention, MJD is an integer.
599 // - MJD number starts at midnight rather than noon.
600 //
601 // If you want a Modified Julian Day that has a fractional part, simply use
602 //
603 
604  double jd = GetJulianDate();
605  if(TMath::IsNaN(jd)) Error(const_cast<char*>("julian day is a NaN"));
606  double mjd = jd - CWB_MJD_REF;
607  return mjd;
608 }
609 
611 
612  int i = 1;
613  while (gps >= gps_leaps_table[i].gps) {++i;if(i>=GPS_LEAPS_TABLE_SIZE) break;}
614  return gps_leaps_table[i-1].gps_utc;
615 }
616 
617 int wat::Time::UnixToGpsLeaps(int unix_time) {
618 
619  int i = 1;
620  while (unix_time >= (gps_leaps_table[i].gps + UTC_UNIX_SPAN - GpsToGpsLeaps(gps_leaps_table[i].gps)))
621  {++i;if(i>=GPS_LEAPS_TABLE_SIZE) break;}
622  return gps_leaps_table[i-1].gps_utc;
623 }
624 
625 //-----------------------------------------------------------------------------
626 // Output insertion operator.
627 // param: Output& out
628 // param: Time& time
629 // return: Output&
630 // exc: write_failure
631 
632 ostream& wat::operator<<(ostream& out, Time& time) {
633 
634  out << time.GetSec() << ":";
635  out.fill('0');
636  out.width(9);
637  out << time.GetNSec();
638  out << endl;
639  return out;
640 }
641 
642 //-----------------------------------------------------------------------------
643 // Get the number of seconds.
644 // return: INT_4S
645 
647  return mSec;
648 }
649 
650 //-----------------------------------------------------------------------------
651 // Get the number of nanoseconds.
652 // return: INT_4U
653 
655  return mNSec;
656 }
wavearray< double > t(hp.size())
void Error(char *msg)
Definition: time.hh:249
#define CWB_MJD_REF
Definition: time.cc:22
INT_4S mSec
Definition: time.hh:251
Time & operator=(Time &time)
Definition: time.cc:83
TString GetDateString()
Definition: time.cc:461
TH1 * t1
int GetSecond()
Definition: time.hh:198
TString("c")
ofstream out
Definition: cwb_merge.C:214
INT_4U GetNSec()
Definition: time.cc:654
int GetHour()
Definition: time.hh:190
void SetDate(int ss, int mm, int hh, int DD, int MM, int YY, int nsec=0)
Definition: time.cc:420
bool operator!=(Time &time)
Definition: time.cc:208
void SetDateString(TString date)
Definition: time.cc:331
Time operator-(Time &t1, Time &t2)
Definition: time.cc:258
void SetString(char *date, int nsec=0)
Definition: time.cc:373
Time operator+(Time &t1, Time &t2)
Definition: time.cc:246
i drho i
Time operator*(Time &t, double &d)
Definition: time.cc:269
wavearray< double > hh
Definition: Regression_H1.C:73
Definition: alm.hh:38
INT_4U SetNSec(INT_4U nsec)
Definition: time.hh:139
cout<< "Selected Pixels : "<< nPix<< endl;wc.cluster(1, 1);SSeries< double > ss
int gps_utc
Definition: time.hh:46
istream & operator>>(istream &in, Time &time)
Definition: time.cc:303
void UnixToGps()
Definition: time.hh:231
double operator/(Time &time)
Definition: time.cc:169
wavearray< double > xx
Definition: TestFrame1.C:11
#define GPS_LEAPS_TABLE_SIZE
Definition: time.hh:40
#define INT_4U
Definition: time.hh:35
ostream & operator<<(ostream &out, Time &time)
Definition: time.cc:632
void SetDouble(double dt)
Definition: time.cc:311
double * tmp
Definition: testWDM_5.C:31
int GetMonth()
Definition: time.hh:182
bool operator==(Time &time)
Definition: time.cc:181
TObjArray * token
double GetJulianDate()
Definition: time.cc:523
static const gps_leap gps_leaps_table[GPS_LEAPS_TABLE_SIZE]
Definition: time.hh:52
INT_4U mNSec
Definition: time.hh:252
bool operator<=(Time &time)
Definition: time.cc:190
wavearray< double > yy
Definition: TestFrame5.C:12
Time operator/(Time &t, double &d)
Definition: time.cc:280
double dt
s s
Definition: cwb_net.C:155
int UnixToGpsLeaps()
Definition: time.hh:221
double gps
ifstream in
Time & operator*=(double &d)
Definition: time.cc:133
int GetMinute()
Definition: time.hh:194
Time(INT_4S sec=0, INT_4U nsec=0)
Definition: time.cc:44
double GetModJulianDate()
Definition: time.cc:591
Time & operator-=(Time &time)
Definition: time.cc:115
sprintf(tfres,"(1/%g)x(%g) (sec)x(Hz)", 2 *df, df)
INT_4S SetSec(INT_4S s)
Definition: time.hh:136
Time & operator+=(Time &time)
Definition: time.cc:98
INT_4S GetSec()
Definition: time.cc:646
#define INT_4S
Definition: time.hh:34
double GetDouble()
Definition: time.cc:320
void Print()
Definition: time.cc:511
#define UTC_UNIX_SPAN
Definition: time.hh:37
double ctime
void GpsToUnix()
Definition: time.hh:237
bool operator<(Time &time)
Definition: time.cc:217
Time & operator/=(double &d)
Definition: time.cc:155
int GpsToGpsLeaps()
Definition: time.hh:220
int GetDay()
Definition: time.hh:186
int GetYear()
Definition: time.hh:178
bool operator>=(Time &time)
Definition: time.cc:199
bool operator>(Time &time)
Definition: time.cc:231