Changeset 7703 for trunk/psLib/src/astro/psTime.c
- Timestamp:
- Jun 26, 2006, 6:13:07 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astro/psTime.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psTime.c
r7701 r7703 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.8 8$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-06-27 0 3:48:35$12 * @version $Revision: 1.89 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-06-27 04:13:07 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1629 1629 } 1630 1630 1631 psTime* psTimeStrptime(const char *s, const char *format) 1632 { 1633 PS_ASSERT_PTR_NON_NULL(s, NULL); 1634 PS_ASSERT_PTR_NON_NULL(format, NULL); 1635 1636 struct tm tmTime; 1637 char *lastChar = strptime((char *)s, "%EY-%m-%d%t%T", &tmTime); 1638 if (!lastChar) { 1639 psError(PS_ERR_UNKNOWN, true, "error parsing time string"); 1640 return NULL; 1641 } 1642 1643 if (*lastChar != '\0') { 1644 psWarning("time string was not completely consumed\n"); 1645 } 1646 1647 psTime *time = psTimeFromTM(&tmTime); 1648 if (!time) { 1649 psError(PS_ERR_UNKNOWN, false, "failed to generate a psTime"); 1650 return NULL; 1651 } 1652 1653 return time; 1654 } 1655 1631 1656 psTime* psTimeMath(const psTime *time, 1632 1657 double delta)
Note:
See TracChangeset
for help on using the changeset viewer.
