Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
1976003e
Commit
1976003e
authored
Aug 10, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
time/FileTime: allow negative times
parent
488afc47
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
FileTime.hxx
src/time/FileTime.hxx
+8
-2
No files found.
src/time/FileTime.hxx
View file @
1976003e
...
...
@@ -47,10 +47,16 @@ ToUint64(FILETIME ft) noexcept
return
ConstructUint64
(
ft
.
dwLowDateTime
,
ft
.
dwHighDateTime
);
}
constexpr
int_least64_t
ToInt64
(
FILETIME
ft
)
noexcept
{
return
ToUint64
(
ft
);
}
constexpr
time_t
FileTimeToTimeT
(
FILETIME
ft
)
noexcept
{
return
(
To
Ui
nt64
(
ft
)
-
116444736000000000
)
/
10000000
;
return
(
To
I
nt64
(
ft
)
-
116444736000000000
)
/
10000000
;
}
inline
std
::
chrono
::
system_clock
::
time_point
...
...
@@ -63,7 +69,7 @@ FileTimeToChrono(FILETIME ft) noexcept
constexpr
std
::
chrono
::
seconds
DeltaFileTimeS
(
FILETIME
a
,
FILETIME
b
)
noexcept
{
return
std
::
chrono
::
seconds
((
To
Uint64
(
a
)
-
ToUi
nt64
(
b
))
/
10000000
);
return
std
::
chrono
::
seconds
((
To
Int64
(
a
)
-
ToI
nt64
(
b
))
/
10000000
);
}
#endif
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