Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
fb8df267
Commit
fb8df267
authored
Feb 27, 2017
by
Stéphane Graber
Committed by
GitHub
Feb 27, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1447 from brauner/2017-02-27/fix_logging_timestamps
log: fix lxc_unix_epoch_to_utc()
parents
e3e54165
86698d38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
log.c
src/lxc/log.c
+6
-1
No files found.
src/lxc/log.c
View file @
fb8df267
...
...
@@ -173,7 +173,7 @@ int lxc_unix_epoch_to_utc(char *buf, size_t bufsize, const struct timespec *time
yoe
=
(
doe
-
doe
/
1460
+
doe
/
36524
-
doe
/
146096
)
/
365
;
/* Given year-of-era, and era, one can now compute the year. */
year
=
(
yoe
)
+
era
*
400
;
year
=
yoe
+
era
*
400
;
/* Also the day-of-year, again with the year beginning on Mar. 1, can be
* computed from the day-of-era and year-of-era.
...
...
@@ -193,6 +193,11 @@ int lxc_unix_epoch_to_utc(char *buf, size_t bufsize, const struct timespec *time
*/
month
=
mp
+
(
mp
<
10
?
3
:
-
9
);
/* The algorithm assumes that a year begins on 1 March, so add 1 before
* that. */
if
(
month
<
3
)
year
++
;
/* Transform days in the epoch to seconds. */
d_in_s
=
epoch_to_days
*
86400
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment