summaryrefslogtreecommitdiff
path: root/time
diff options
context:
space:
mode:
authorrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>1999-12-21 16:21:43 +0000
committerrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>1999-12-21 16:21:43 +0000
commit24b18ea322060aa6ba532384bcaa0ce2a5ce3372 (patch)
tree9b539321537440b593ab0667c35e03c453a85313 /time
parent52b29d000fbfa6b59b440514f523b0deaf0d4f28 (diff)
downloadlibapr-24b18ea322060aa6ba532384bcaa0ce2a5ce3372.tar.gz
Change ap_gm_timestr_822 to ap_timestr. Now, one function can be used to get
a timestr for GMT and Localtimes. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@59548 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'time')
-rw-r--r--time/unix/timestr.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/time/unix/timestr.c b/time/unix/timestr.c
index 5a0e9b672..830357560 100644
--- a/time/unix/timestr.c
+++ b/time/unix/timestr.c
@@ -65,7 +65,7 @@ API_VAR_EXPORT const char ap_day_snames[7][4] =
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
-ap_status_t ap_gm_timestr_822(char **date_str, struct atime_t *t, ap_context_t *p)
+ap_status_t ap_timestr(char **date_str, struct atime_t *t, ap_timetype_e type, ap_context_t *p)
{
struct tm *tms;
char *date_str_ptr;
@@ -74,9 +74,7 @@ ap_status_t ap_gm_timestr_822(char **date_str, struct atime_t *t, ap_context_t *
(*date_str) = ap_palloc(p, 48 * sizeof(char));
date_str_ptr = (*date_str);
- if (t->time_ex == 0) {
- ap_explode_time(t, APR_UTCTIME);
- }
+ ap_explode_time(t, type);
/* Assumption: this is always 3 */
/* i = strlen(ap_day_snames[tms->tm_wday]); */
@@ -107,10 +105,12 @@ ap_status_t ap_gm_timestr_822(char **date_str, struct atime_t *t, ap_context_t *
*date_str_ptr++ = ':';
*date_str_ptr++ = t->explodedtime->tm_sec / 10 + '0';
*date_str_ptr++ = t->explodedtime->tm_sec % 10 + '0';
- *date_str_ptr++ = ' ';
- *date_str_ptr++ = 'G';
- *date_str_ptr++ = 'M';
- *date_str_ptr++ = 'T';
+ if (type == APR_UTCTIME) {
+ *date_str_ptr++ = ' ';
+ *date_str_ptr++ = 'G';
+ *date_str_ptr++ = 'M';
+ *date_str_ptr++ = 'T';
+ }
*date_str_ptr = '\0';
return APR_SUCCESS;
/* RFC date format; as strftime '%a, %d %b %Y %T GMT' */