Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Alexander Lapshin
common
Commits
d217213d
Commit
d217213d
authored
Jan 24, 2020
by
Alexander Lapshin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
68c5520b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
TimeFunctions.h
utils/TimeFunctions.h
+13
-0
No files found.
utils/TimeFunctions.h
View file @
d217213d
...
...
@@ -7,6 +7,8 @@
#include <sstream>
#include "globals.h"
#include "TextFunctions.h"
#include <chrono>
#include <ctime>
static
void
GetPrecK
(
int
msprec
,
int
&
k1
,
int
&
k2
)
{
...
...
@@ -480,3 +482,14 @@ static std::string calc_nightid(const TimeJD& date, const double lon_deg)
string_replace
(
str
,
"/"
,
""
);
return
str
;
}
inline
std
::
string
get_current_time
(
const
std
::
string
&
format
)
{
const
auto
now
=
std
::
chrono
::
system_clock
::
now
();
auto
in_time_t
=
std
::
chrono
::
system_clock
::
to_time_t
(
now
);
std
::
stringstream
ss
;
ss
<<
std
::
put_time
(
std
::
gmtime
(
&
in_time_t
),
format
.
c_str
());
return
ss
.
str
();
}
\ No newline at end of file
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