Changeset 1258
- Timestamp:
- Jul 22, 2004, 9:46:24 AM (22 years ago)
- Location:
- trunk/psLib
- Files:
-
- 3 edited
-
src/astro/psTime.c (modified) (2 diffs)
-
src/astronomy/psTime.c (modified) (2 diffs)
-
test/astronomy/tst_psTime_01.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psTime.c
r1256 r1258 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-07-22 01:02:53$14 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-07-22 19:46:24 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 432 432 } 433 433 434 // Back to 1969435 434 n = time->tm_year + 1900 - 1; 436 435 epoch = (time->tm_year - 70) * SEC_PER_YEAR + ((n/4 - n/100 + n/400) - -
trunk/psLib/src/astronomy/psTime.c
r1256 r1258 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-07-22 01:02:53$14 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-07-22 19:46:24 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 432 432 } 433 433 434 // Back to 1969435 434 n = time->tm_year + 1900 - 1; 436 435 epoch = (time->tm_year - 70) * SEC_PER_YEAR + ((n/4 - n/100 + n/400) - -
trunk/psLib/test/astronomy/tst_psTime_01.c
r1256 r1258 21 21 * @author Ross Harman, MHPCC 22 22 * 23 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $24 * @date $Date: 2004-07-22 01:03:18 $23 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2004-07-22 19:45:58 $ 25 25 * 26 26 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 30 30 #include "pslib.h" 31 31 #include "psTest.h" 32 #include <string.h> 32 33 33 34 int main(int argc, char* argv[]) … … 35 36 psTime time; 36 37 psTime testTime; 38 char *testString = "2004/07/21,18:22:24.272"; 37 39 38 40 // Test time was taken at July 21, 2004 at 18:22:24.272044 … … 49 51 //Test B - Print test time 50 52 printPositiveTestHeader(stdout,"psTime", "Print test time"); 51 printf("Test time: July 21, 2004 at 18:22:24.272044\n");52 53 printf("Test time: Seconds = %ld Microseconds = %ld\n", (long)testTime.tv_sec, (long)testTime.tv_usec); 53 54 printFooter(stdout, "psTime", "Print test time", true); … … 58 59 char *isoString; 59 60 isoString = psTimeToISO(testTime); 60 printf("ISO = %s\n", isoString); 61 if(strncmp(isoString, testString, 256)) { 62 printf("ERROR - ISO string incorrect\n"); 63 printf("Expected: %s\n", testString); 64 printf("Returned: %s\n", isoString); 65 } 61 66 printFooter(stdout, "psTime", "Convert psTime to ISO time", true); 62 67
Note:
See TracChangeset
for help on using the changeset viewer.
