ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/hopm/trunk/src/misc.c
(Generate patch)

Comparing hopm/trunk/src/misc.c (file contents):
Revision 6969 by michael, Sat Dec 19 20:17:07 2015 UTC vs.
Revision 6970 by michael, Sat Dec 19 20:29:27 2015 UTC

# Line 26 | Line 26
26   #include "misc.h"
27  
28  
29 + const char *
30 + date_iso8601(time_t lclock)
31 + {
32 +  static char buf[32];
33 +  static time_t lclock_last;
34 +
35 +  if (!lclock)
36 +    lclock = time(0);
37 +
38 +  if (lclock_last != lclock)
39 +  {
40 +    lclock_last = lclock;
41 +    strftime(buf, sizeof(buf), "%FT%T%z", localtime(&lclock));
42 +  }
43 +
44 +  return buf;
45 + }
46 +
47   /*
48   * Split a time_t into an English-language explanation of how
49   * much time it represents, e.g. "2 hours 45 minutes 8 seconds"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines