Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
ef76bcaf
Commit
ef76bcaf
authored
20 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Add some more comments to time conversion
parent
e014144f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/liblutil/utils.c
+5
-1
5 additions, 1 deletion
libraries/liblutil/utils.c
with
5 additions
and
1 deletion
libraries/liblutil/utils.c
+
5
−
1
View file @
ef76bcaf
...
...
@@ -173,12 +173,15 @@ int lutil_tm2time( struct lutil_tm *tm, struct lutil_timet *tt )
/* add in days in this month */
tt
->
tt_sec
+=
(
tm
->
tm_mday
-
1
);
/* this function can handle a range of about 17408 years... */
/* 86400 seconds in a day, divided by 128 = 675 */
tt
->
tt_sec
*=
675
;
/* move high 7 bits into tt_gsec */
tt
->
tt_gsec
=
tt
->
tt_sec
>>
25
;
tt
->
tt_sec
-=
tt
->
tt_gsec
<<
25
;
/*
convert to
hours */
/*
get
hours */
sec
=
tm
->
tm_hour
;
/* convert to minutes */
...
...
@@ -189,6 +192,7 @@ int lutil_tm2time( struct lutil_tm *tm, struct lutil_timet *tt )
sec
*=
60L
;
sec
+=
tm
->
tm_sec
;
/* add remaining seconds */
tt
->
tt_sec
<<=
7
;
tt
->
tt_sec
+=
sec
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment