mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 21:42:58 +00:00
refac
This commit is contained in:
parent
b2028d187d
commit
827dd1b044
@ -36,13 +36,17 @@ class Tools:
|
||||
|
||||
def get_current_time(self) -> str:
|
||||
"""
|
||||
Get the current time.
|
||||
Get the current time in a more human-readable format.
|
||||
:return: The current time.
|
||||
"""
|
||||
|
||||
now = datetime.now()
|
||||
current_time = now.strftime("%H:%M:%S")
|
||||
return f"Current Time = {current_time}"
|
||||
current_time = now.strftime("%I:%M:%S %p") # Using 12-hour format with AM/PM
|
||||
current_date = now.strftime(
|
||||
"%A, %B %d, %Y"
|
||||
) # Full weekday, month name, day, and year
|
||||
|
||||
return f"Current Date and Time = {current_date}, {current_time}"
|
||||
|
||||
def calculator(self, equation: str) -> str:
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user