Commit 2ce2cdbd authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

add time module

parent 8b383347
...@@ -34,6 +34,7 @@ from csst_dfs_api.sls.level2spectra import Level2SpectraApi as SlsLevel2DataApi ...@@ -34,6 +34,7 @@ from csst_dfs_api.sls.level2spectra import Level2SpectraApi as SlsLevel2DataApi
from .logger import get_logger from .logger import get_logger
from .params import CSST_PARAMS as CP from .params import CSST_PARAMS as CP
from .params import DFS_CONF from .params import DFS_CONF
from .time import now, now_dfs
class CsstMsDataManager: class CsstMsDataManager:
...@@ -289,8 +290,11 @@ class CsstMsDataManager: ...@@ -289,8 +290,11 @@ class CsstMsDataManager:
@staticmethod @staticmethod
def now(): def now():
""" Return ISOT8601 format datetime. """ return now()
return datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%S.%f')
@staticmethod
def now_dfs():
return now_dfs()
# DFS APIs # DFS APIs
@property @property
......
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')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment