Changeset 1385 for trunk/psLib/src/astro/psTime.c
- Timestamp:
- Aug 4, 2004, 1:37:39 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astro/psTime.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psTime.c
r1272 r1385 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-0 7-22 21:24:54$14 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-04 23:37:39 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 100 100 static double leapseconds[NUM_LEAPSECOND_UPDATES][2] = 101 101 { 102 {2441317.5, 10.0}, 103 {2441499.5, 11.0}, 104 {2441683.5, 12.0}, 105 {2442048.5, 13.0}, 106 {2442413.5, 14.0}, 107 {2442778.5, 15.0}, 108 {2443144.5, 16.0}, 109 {2443509.5, 17.0}, 110 {2443874.5, 18.0}, 111 {2444239.5, 19.0}, 112 {2444786.5, 20.0}, 113 {2445151.5, 21.0}, 114 {2445516.5, 22.0}, 115 {2446247.5, 23.0}, 116 {2447161.5, 24.0}, 117 {2447892.5, 25.0}, 118 {2448257.5, 26.0}, 119 {2448804.5, 27.0}, 120 {2449169.5, 28.0}, 121 {2449534.5, 29.0}, 122 {2450083.5, 30.0}, 123 {2450630.5, 31.0}, 124 {2451179.5, 32.0} 102 { 103 2441317.5, 10.0 104 }, 105 { 106 2441499.5, 11.0 107 }, 108 { 109 2441683.5, 12.0 110 }, 111 { 112 2442048.5, 13.0 113 }, 114 { 115 2442413.5, 14.0 116 }, 117 { 118 2442778.5, 15.0 119 }, 120 { 121 2443144.5, 16.0 122 }, 123 { 124 2443509.5, 17.0 125 }, 126 { 127 2443874.5, 18.0 128 }, 129 { 130 2444239.5, 19.0 131 }, 132 { 133 2444786.5, 20.0 134 }, 135 { 136 2445151.5, 21.0 137 }, 138 { 139 2445516.5, 22.0 140 }, 141 { 142 2446247.5, 23.0 143 }, 144 { 145 2447161.5, 24.0 146 }, 147 { 148 2447892.5, 25.0 149 }, 150 { 151 2448257.5, 26.0 152 }, 153 { 154 2448804.5, 27.0 155 }, 156 { 157 2449169.5, 28.0 158 }, 159 { 160 2449534.5, 29.0 161 }, 162 { 163 2450083.5, 30.0 164 }, 165 { 166 2450630.5, 31.0 167 }, 168 { 169 2451179.5, 32.0 170 } 125 171 }; 126 172 … … 395 441 psError(__func__,"Null value for timeval arg not allowed"); 396 442 return outTime; 397 } else if(time->tv_sec < 0) 398 { 399 psError(__func__,"Negative seconds are not allowed: %ld", time->tv_sec); 400 return outTime; 401 } else if(time->tv_usec<0) 402 { 403 psError(__func__,"Negative microseconds are not allowed: %ld", time->tv_usec); 404 return outTime; 405 } 443 } else 444 if(time->tv_sec < 0) 445 { 446 psError(__func__,"Negative seconds are not allowed: %ld", time->tv_sec); 447 return outTime; 448 } else 449 if(time->tv_usec<0) 450 { 451 psError(__func__,"Negative microseconds are not allowed: %ld", time->tv_usec); 452 return outTime; 453 } 406 454 407 455 // Convert to psTime/TAI … … 420 468 int n; 421 469 int y; 422 int mon [] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 470 int mon [] = 471 { 472 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 473 }; 423 474 long epoch; 424 475 psTime outTime; … … 433 484 psError(__func__,"Null value for tm arg not allowed"); 434 485 return outTime; 435 } else if(time->tm_year < 70) 436 { 437 psError(__func__,"Input times earlier than 1970 not allowed. Value: %d", time->tm_year+1900); 438 return outTime; 439 } else if(time->tm_mon<0 || time->tm_mon>11) 440 { 441 psError(__func__,"Month must have a value from 0 to 11. Value: %d", time->tm_mon); 442 return outTime; 443 } else if(time->tm_mday<1 || time->tm_mday>31) 444 { 445 psError(__func__,"Day must have a value from 1 to 31. Value: %d", time->tm_mday); 446 return outTime; 447 } else if(time->tm_hour<0 || time->tm_hour>23) 448 { 449 psError(__func__,"Hour must have a value from 0 to 23. Value: %d", time->tm_hour); 450 return outTime; 451 } else if(time->tm_min<0 || time->tm_min>59) 452 { 453 psError(__func__,"Minute must have a value from 0 to 59. Value: %d", time->tm_min); 454 return outTime; 455 } else if(time->tm_sec<0 || time->tm_sec>59) 456 { 457 psError(__func__,"Second must have a value from 0 to 59. Value: %d", time->tm_sec); 458 return outTime; 459 } 486 } else 487 if(time->tm_year < 70) 488 { 489 psError(__func__,"Input times earlier than 1970 not allowed. Value: %d", time->tm_year+1900); 490 return outTime; 491 } else 492 if(time->tm_mon<0 || time->tm_mon>11) 493 { 494 psError(__func__,"Month must have a value from 0 to 11. Value: %d", time->tm_mon); 495 return outTime; 496 } else 497 if(time->tm_mday<1 || time->tm_mday>31) 498 { 499 psError(__func__,"Day must have a value from 1 to 31. Value: %d", time->tm_mday); 500 return outTime; 501 } else 502 if(time->tm_hour<0 || time->tm_hour>23) 503 { 504 psError(__func__,"Hour must have a value from 0 to 23. Value: %d", time->tm_hour); 505 return outTime; 506 } else 507 if(time->tm_min<0 || time->tm_min>59) 508 { 509 psError(__func__,"Minute must have a value from 0 to 59. Value: %d", time->tm_min); 510 return outTime; 511 } else 512 if(time->tm_sec<0 || time->tm_sec>59) 513 { 514 psError(__func__,"Second must have a value from 0 to 59. Value: %d", time->tm_sec); 515 return outTime; 516 } 460 517 461 518 n = time->tm_year + 1900 - 1;
Note:
See TracChangeset
for help on using the changeset viewer.
