Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update on generic functions #86

Merged
merged 2 commits into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pyCHX/chx_generic_functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import copy
import datetime
from datetime import datetime
from os import listdir
from shutil import copyfile

Expand Down Expand Up @@ -895,7 +895,7 @@ def get_current_time():
"""get current time in a fomart of year/month/date/hour(24)/min/sec/,
e.g. 2009-01-05 22:14:39
"""
loc_dt = datetime.datetime.now(pytz.timezone("US/Eastern"))
loc_dt = datetime.now(pytz.timezone("US/Eastern"))
fmt = "%Y-%m-%d %H:%M:%S"
return loc_dt.strftime(fmt)

Expand Down Expand Up @@ -4926,7 +4926,7 @@ def trans_tf_to_td(tf, dtype="dframe"):
"""July 02, 2015, Y.G.@CHX
Translate epoch time to string
"""
import datetime
from datetime import datetime

import numpy as np
import pandas as pd
Expand All @@ -4939,7 +4939,7 @@ def trans_tf_to_td(tf, dtype="dframe"):
ind = tf.index
else:
ind = range(len(tf))
td = np.array([datetime.datetime.fromtimestamp(tf[i]) for i in ind])
td = np.array([datetime.fromtimestamp(tf[i]) for i in ind])
return td


Expand Down
Loading