mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Use ltime for XML export/import of date and datetime attributes
This commit is contained in:
parent
63fdfa1688
commit
b7ee024ffb
13
src/elogd.c
13
src/elogd.c
@ -19673,7 +19673,10 @@ time_t convert_date(char *date_string)
|
|||||||
strlcpy(str, date_string, sizeof(str));
|
strlcpy(str, date_string, sizeof(str));
|
||||||
month = day = year = 0;
|
month = day = year = 0;
|
||||||
|
|
||||||
if (strchr(str, '/')) {
|
if (strchr (str, '[')) {
|
||||||
|
ltime = atoi(strchr (str, '[')+1);
|
||||||
|
return ltime;
|
||||||
|
} else if (strchr(str, '/')) {
|
||||||
/* MM/DD/YY format */
|
/* MM/DD/YY format */
|
||||||
p = strtok(str, "/");
|
p = strtok(str, "/");
|
||||||
if (p) {
|
if (p) {
|
||||||
@ -19735,7 +19738,10 @@ time_t convert_datetime(char *date_string)
|
|||||||
strlcpy(str, date_string, sizeof(str));
|
strlcpy(str, date_string, sizeof(str));
|
||||||
month = day = year = 0;
|
month = day = year = 0;
|
||||||
|
|
||||||
if (strchr(str, '/')) {
|
if (strchr (str, '[')) {
|
||||||
|
ltime = atoi(strchr (str, '[')+1);
|
||||||
|
return ltime;
|
||||||
|
} else if (strchr(str, '/')) {
|
||||||
/* MM/DD/YY format */
|
/* MM/DD/YY format */
|
||||||
p = strtok(str, "/");
|
p = strtok(str, "/");
|
||||||
if (p) {
|
if (p) {
|
||||||
@ -21797,6 +21803,7 @@ void show_elog_list(LOGBOOK * lbs, int past_n, int last_n, int page_n, BOOL defa
|
|||||||
strcpy(str, "-");
|
strcpy(str, "-");
|
||||||
else
|
else
|
||||||
my_strftime(str, sizeof(str), format, ptms);
|
my_strftime(str, sizeof(str), format, ptms);
|
||||||
|
sprintf(str+strlen(str), " [%ld]", ltime);
|
||||||
|
|
||||||
} else if (attr_flags[i] & AF_DATETIME) {
|
} else if (attr_flags[i] & AF_DATETIME) {
|
||||||
|
|
||||||
@ -21812,7 +21819,7 @@ void show_elog_list(LOGBOOK * lbs, int past_n, int last_n, int page_n, BOOL defa
|
|||||||
strcpy(str, "-");
|
strcpy(str, "-");
|
||||||
else
|
else
|
||||||
my_strftime(str, sizeof(str), format, ptms);
|
my_strftime(str, sizeof(str), format, ptms);
|
||||||
|
sprintf(str+strlen(str), " [%ld]", ltime);
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlencode(str);
|
xmlencode(str);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user