# index | Marsho AI
Kawaii, Intelligent and Easy to Extend

Skip to content

# Module `nonebot_plugin_marshoai.plugins_test.marshoai_basic` ​

`@on_function_call(description='获取当前时间，日期和星期')`

### async func `get_current_time() -> str` ​

Description: 获取当前的时间和日期

Source code or View on GitHub
python

    @on_function_call(description='获取当前时间，日期和星期')
    async def get_current_time() -> str:
        current_time = DateTime.now()
        time_prompt = '现在的时间是 {}，{}，{}。'.format(current_time.strftime('%Y.%m.%d %H:%M:%S'), weekdays[current_time.weekday()], current_time.chinesize.date_hanzify('农历{干支年}{生肖}年 {月份}月{数序日}'))
        return time_prompt