Changeset 7961
- Timestamp:
- Jul 24, 2006, 3:16:04 PM (20 years ago)
- Location:
- trunk/psLib/src/astro
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psTime.c
r7942 r7961 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.9 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-07-2 0 12:59:07$12 * @version $Revision: 1.92 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-07-25 01:16:04 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1681 1681 } 1682 1682 1683 psString psTimeStrftime(const psTime *time, const char *format) 1684 { 1685 PS_ASSERT_PTR_NON_NULL(time, NULL); 1686 PS_ASSERT_PTR_NON_NULL(format, NULL); 1687 1688 struct tm *tmTime = psTimeToTM(time); 1689 1690 psString s = psAlloc(MAX_TIME_STRING_LENGTH); 1691 size_t size = strftime(s, MAX_TIME_STRING_LENGTH, format, tmTime); 1692 psFree(tmTime); 1693 // it's worth nothing that strftime() can zero without an error having 1694 // occured don't believe it's worth supporting that edge case. See 1695 // strftime(3) for further details. 1696 if (size == 0) { 1697 psError(PS_ERR_UNKNOWN, true, "failed to stringify a psTime"); 1698 return NULL; 1699 } 1700 1701 return s; 1702 } 1703 1683 1704 psTime* psTimeMath(const psTime *time, 1684 1705 double delta) -
trunk/psLib/src/astro/psTime.h
r7703 r7961 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.4 7$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-0 6-27 04:13:07$13 * @version $Revision: 1.48 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-07-25 01:16:04 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 375 375 376 376 psTime* psTimeStrptime( 377 const char *s, ///< string to be converted 378 const char *format ///< strptime format 377 const char *s, ///< string to be converted 378 const char *format ///< strptime(3) format 379 ); 380 381 /** Convert a psTime into a formated string. 382 * 383 * Converts a psTime, using a strftime(3) format, into a formatted string. 384 * See strftime(3) for documentation on this format. 385 * 386 * @return psString: string. 387 */ 388 389 psString psTimeStrftime( 390 const psTime *time, ///< Time to be formatted. 391 const char *format ///< strftime(3) format 379 392 ); 380 393
Note:
See TracChangeset
for help on using the changeset viewer.
