Jeff Thompson | 9ae4d78 | 2013-10-17 10:25:54 -0700 | [diff] [blame] | 1 | /** |
| 2 | * Copyright (C) 2013 Regents of the University of California. |
| 3 | * @author: Jeff Thompson <jefft0@remap.ucla.edu> |
| 4 | * See COPYING for copyright and distribution information. |
| 5 | */ |
| 6 | |
| 7 | #ifndef NDN_TIME_H |
| 8 | #define NDN_TIME_H |
| 9 | |
Jeff Thompson | 9a8e82f | 2013-10-17 14:13:43 -0700 | [diff] [blame] | 10 | #include <ndn-cpp/c/common.h> |
| 11 | |
Jeff Thompson | 9ae4d78 | 2013-10-17 10:25:54 -0700 | [diff] [blame] | 12 | #ifdef __cplusplus |
| 13 | extern "C" { |
| 14 | #endif |
| 15 | |
| 16 | /** |
| 17 | * Use gettimeofday to return the current time in milliseconds. |
| 18 | * @return The current time in milliseconds since 1/1/1970, including fractions of a millisecond according to timeval.tv_usec. |
| 19 | */ |
Jeff Thompson | 9a8e82f | 2013-10-17 14:13:43 -0700 | [diff] [blame] | 20 | ndn_MillisecondsSince1970 |
Jeff Thompson | 9ae4d78 | 2013-10-17 10:25:54 -0700 | [diff] [blame] | 21 | ndn_getNowMilliseconds(); |
| 22 | |
Jeff Thompson | 5a6ce83 | 2013-10-18 11:54:35 -0700 | [diff] [blame^] | 23 | /** |
| 24 | * Convert the time from milliseconds to ISO time, for example "20131018T184138.423355". |
| 25 | * @param milliseconds The time in milliseconds since 1/1/1970, including fractions of a millisecond. |
| 26 | * @param isoString A buffer of at least 23 bytes to receive the null-terminated ISO time string. |
| 27 | */ |
| 28 | void |
| 29 | ndn_toIsoString(ndn_MillisecondsSince1970 time, char *isoString); |
| 30 | |
Jeff Thompson | 9ae4d78 | 2013-10-17 10:25:54 -0700 | [diff] [blame] | 31 | #ifdef __cplusplus |
| 32 | } |
| 33 | #endif |
| 34 | |
| 35 | #endif |