Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/log_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "log_api.h"
#include <curl/curl.h>
#include <string.h>
#include <locale.h>
#include "sds.h"
#include "inner_log.h"

Expand Down Expand Up @@ -52,6 +53,12 @@ void get_now_time_str(char * buffer, int bufLen)
struct tm * timeinfo;
time (&rawtime);
timeinfo = gmtime(&rawtime);
// make sure time_str is RFC822 format, or server return 400 (InvalidDateFormat)
char *time_locale = setlocale(LC_TIME, "en_US.UTF-8");
if(time_locale == NULL){
printf("error while set LC_TIME to en_US.UTF-8");
}

strftime(buffer, bufLen, "%a, %d %b %Y %H:%M:%S GMT", timeinfo);
}

Expand Down