MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / time_since

Function time_since

scripts/gh_scripts/issue_comment_bot.py:309–314  ·  view source on GitHub ↗

Returns datetime and string representations of the current time, minus the given hour

(hours)

Source from the content-addressed store, hash-verified

307
308
309def time_since(hours):
310 """Returns datetime and string representations of the current time, minus the given hour"""
311 now = datetime.now()
312 # XXX : Add a minute or two to the delta (to avoid dropping issues)?
313 since = now - timedelta(hours=hours)
314 return since, since.strftime("%Y-%m-%dT%H:%M:%S")
315
316
317def add_label_to_issues(issues) -> bool:

Callers 1

filter_issuesFunction · 0.85

Calls 1

nowMethod · 0.45

Tested by

no test coverage detected