Changeset 2251 in ntrip for trunk/BNC/bnctime.cpp
- Timestamp:
- Jan 16, 2010, 10:39:37 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnctime.cpp
r2123 r2251 8 8 9 9 using namespace std; 10 11 double djul(long jj, long mm, double tt) { 12 long ii, kk; 13 double djul ; 14 if( mm <= 2 ) { 15 jj = jj - 1; 16 mm = mm + 12; 17 } 18 ii = jj/100; 19 kk = 2 - ii + ii/4; 20 djul = (365.25*jj - fmod( 365.25*jj, 1.0 )) - 679006.0; 21 djul = djul + floor( 30.6001*(mm + 1) ) + tt + kk; 22 return djul; 23 } 10 24 11 25 // Constructor … … 174 188 } 175 189 190 191 // 192 ////////////////////////////////////////////////////////////////////////////// 193 bncTime& bncTime::set(int year, int month, int day, 194 int hour, int min, double sec) { 195 return set(year, month, day, hour*3600 + min*60 + sec); 196 } 197 198 // 199 ////////////////////////////////////////////////////////////////////////////// 200 bncTime& bncTime::set(int year, int month, int day, double daysec) { 201 _sec = daysec; 202 203 _mjd = (unsigned int)djul(year, month, day); 204 205 while ( _sec >= 86400 ) { 206 _sec-=86400; 207 _mjd++; 208 } 209 while ( _sec < 0 ) { 210 _sec+=86400; 211 _mjd--; 212 } 213 214 return *this; 215 }
Note:
See TracChangeset
for help on using the changeset viewer.