0

I am using AIML 2.0 on Python 3.8, Windows 10 and I am trying to format the date using the date tag:

<aiml version="2.0" encoding="UTF-8">
    <category>
        <pattern>WHAT IS THE DATE</pattern>
        <template>
            It is <date/>
        </template>
    </category>
</aiml>

This will give It is Fri Mar 19 18:01:14 2021

I tried formatting using format and jformat as shown in several examples but it did not work:

    <category>
        <pattern>WHAT IS THE DATE</pattern>
        <template>
            It is <date format="%B %d, %Y" jformat="MMMMMMMMM dd, yyyy"/>
        </template>
    </category>

The output: It is Fri Mar 19 18:01:14 2021

ccsv
  • 8,188
  • 12
  • 53
  • 97
  • What interpreter are you using for this? The default output from the date tag is this format: "Friday, March 19, 2021", it shows the day in full and doesn't display the time, as in your example. It looks to me like your interpreter cannot handle the date tag correctly. – Steve Worswick Mar 22 '21 at 08:21
  • @SteveWorswick I am using the default python over windows CMD. – ccsv Mar 25 '21 at 00:04
  • But surely, you are using some kind of AIML interpreter? – Steve Worswick Mar 25 '21 at 01:28
  • @SteveWorswick not sure I pip installed the python-aiml library I don't know what interpreter comes with it – ccsv Mar 25 '21 at 06:14
  • Ah ok. Unfortunately, it appears whoever created the library hasn't handle the date tag correctly. Your AIML is perfectly valid and should work. I tried it in my bot and it produces the correct output. – Steve Worswick Mar 25 '21 at 11:21
  • @SteveWorswick ok thanks that is what I thought – ccsv Mar 30 '21 at 01:11

0 Answers0