Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
csst_common
Commits
2ce2cdbd
Commit
2ce2cdbd
authored
Mar 09, 2023
by
BO ZHANG
🏀
Browse files
add time module
parent
8b383347
Changes
2
Hide whitespace changes
Inline
Side-by-side
csst_common/data_manager.py
View file @
2ce2cdbd
...
...
@@ -34,6 +34,7 @@ from csst_dfs_api.sls.level2spectra import Level2SpectraApi as SlsLevel2DataApi
from
.logger
import
get_logger
from
.params
import
CSST_PARAMS
as
CP
from
.params
import
DFS_CONF
from
.time
import
now
,
now_dfs
class
CsstMsDataManager
:
...
...
@@ -289,8 +290,11 @@ class CsstMsDataManager:
@
staticmethod
def
now
():
""" Return ISOT8601 format datetime. """
return
datetime
.
datetime
.
now
().
strftime
(
'%Y-%m-%dT%H:%M:%S.%f'
)
return
now
()
@
staticmethod
def
now_dfs
():
return
now_dfs
()
# DFS APIs
@
property
...
...
csst_common/time.py
0 → 100644
View file @
2ce2cdbd
import
datetime
def
now
():
""" Return ISOT8601 format datetime, for time stamps in data products. """
return
datetime
.
datetime
.
now
().
strftime
(
'%Y-%m-%dT%H:%M:%S.%f'
)
def
now_dfs
():
""" Return ISOT8601 format datetime, for DFS usage only. """
return
datetime
.
datetime
.
now
().
strftime
(
'%Y-%m-%d %H:%M:%S'
)
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment