User Input - is there a variable to use within the Query

Hi @landed

You can use a custom action and add a library for the date and time?

Something like

import os
import datetime
import pytz

def current_time_and_date(: str):
    """
    Return the current time and date

    Args:
         (string): 
    Envs:
         (string): 
    """

    # Insert your PYTHON code below. You can access environment variables using os.environ[].
    # Currently, only the requests library is supported, but more libraries will be available soon.
    # Use print statements or return values to display results to the user.
    # If you save a png, pdf, csv, jpg, webp, gif, or html file in the root directory, it will be automatically displayed to the user.
    # You do not have to call this function as the bot will automatically call and fill in the parameters.

    # Get current time in UTC
    utc_time = datetime.datetime.now(pytz.utc)
    print(utc_time)

    # Convert to a specific timezone (e.g., Australia/Melbourne)
    melbourne_time = utc_time.astimezone(pytz.timezone('Australia/Melbourne'))
    print(melbourne_time)
1 Like