MCPcopy
hub / github.com/InstaPy/InstaPy / get_time

Function get_time

instapy/time_util.py:42–62  ·  view source on GitHub ↗

To get a use out of this helpful function catch in the same order of passed parameters

(labels)

Source from the content-addressed store, hash-verified

40
41
42def get_time(labels):
43 """To get a use out of this helpful function
44 catch in the same order of passed parameters"""
45 if not isinstance(labels, list):
46 labels = [labels]
47
48 results = []
49
50 for label in labels:
51 if label == "this_minute":
52 results.append(datetime.now().strftime("%M"))
53
54 if label == "this_hour":
55 results.append(datetime.now().strftime("%H"))
56
57 elif label == "today":
58 results.append(datetime.now().strftime("%Y-%m-%d"))
59
60 results = results if len(results) > 1 else results[0]
61
62 return results

Callers 1

quota_supervisorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected