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
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
......
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