Skip to content

Commit

Permalink
Merge pull request #86 from NSLS-II/updates-20240509-generic-function
Browse files Browse the repository at this point in the history
update on generic functions
  • Loading branch information
mrakitin authored May 13, 2024
2 parents 19d27f2 + 004895f commit 21765b0
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 21765b0

Please sign in to comment.