3 * ====================================================================
4 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
6 * This software is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at http://subversion.tigris.org/license-1.html.
9 * If newer versions of this license are posted there, you may use a
10 * newer version instead, at your option.
12 * This software consists of voluntary contributions made by many
13 * individuals. For exact contribution history, see the revision
14 * history and logs, available at http://subversion.tigris.org/.
15 * ====================================================================
19 * @brief Time/date utilities
25 #include <apr_pools.h>
28 #include "svn_error.h"
32 #endif /* __cplusplus */
35 /** Convert @a when to a <tt>const char *</tt> representation allocated
36 * in @a pool. Use svn_time_from_cstring() for the reverse
39 const char *svn_time_to_cstring(apr_time_t when
, apr_pool_t
*pool
);
41 /** Convert @a data to an @c apr_time_t @a when.
42 * Use @a pool for temporary memory allocation.
44 svn_error_t
*svn_time_from_cstring(apr_time_t
*when
, const char *data
,
47 /** Convert @a when to a <tt>const char *</tt> representation allocated
48 * in @a pool, suitable for human display in UTF8.
50 const char *svn_time_to_human_cstring(apr_time_t when
, apr_pool_t
*pool
);
53 /** Convert a human-readable date @a text into an @c apr_time_t, using
54 * @a now as the current time and storing the result in @a result.
55 * The local time zone will be used to compute the appropriate GMT
56 * offset if @a text contains a local time specification. Set @a
57 * matched to indicate whether or not @a text was parsed successfully.
58 * Perform any allocation in @a pool. Return an error iff an internal
59 * error (rather than a simple parse error) occurs.
62 svn_parse_date(svn_boolean_t
*matched
, apr_time_t
*result
, const char *text
,
63 apr_time_t now
, apr_pool_t
*pool
);
66 /** Sleep until the next second, to ensure that any files modified
67 * after we exit have a different timestamp than the one we recorded.
69 void svn_sleep_for_timestamps(void);
73 #endif /* __cplusplus */
75 #endif /* SVN_TIME_H */