AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

<DATE> tag
 
 

i tired using <DATE> tag for getting current time but its not working i tried it with many formats but all it shows is current date. i thought that i am wrong in setting the value of time zone so i did this

<category>
    <
pattern>time</pattern>
    <
template>
    <
date locale="en_US" format="%Z"/>
    </
template>
    </
category

but still the output is current date. can anyone tell me where i am wrong?

 

 
  [ # 1 ]

I use this to tell the time in the UK. See if it works for you.

<category>
    <
pattern>TIME</pattern>
    <
template>
    <
date locale="en_GB" timezone="1" format="%A %d %B %Y %H:%M:%S %p"/>
    </
template>
    </
category

 

 

 
  [ # 2 ]

it is also returning me current date…

 

 
  [ # 3 ]

Did it return the time as well? If not, there is a bug in the interpreter you are using.

 

 
  [ # 4 ]

Assuming you’re using AIML and not flash… this works for me.

<category>
TIME</pattern>

<template><random>
  <li>It’s
  <date format=”%I:%M:%S %p” timezone=”-5”> where I’m located.
  </li>
  <li>Where I’m located, it’s it’s
  <date format=”%I:%M:%S %p” timezone=”-5”>.
  </li>
  <li>Right now, I’m in the U.S. Eastern Time Zone where it’s
  <date format=”%I:%M:%S %p” timezone=”-5”>.
  </li>
</random></template>
</category>

 

 
  [ # 5 ]

no mr.steve it didnt returned the time just the current date. i think mr.steve is right there is a bug in my interpreter because thunder walk your code also just returned the current date.

 

 
  [ # 6 ]

Both Thunder’s, yours and my own examples are perfectly valid AIML categories and so the problem must lie with your interpreter. Is it Program O you use? If so, Dave Morton may be able to help.

 

 
  [ # 7 ]

There’s a known bug in the code for the <DATE> tag where only the actual date is displayed. I wrote a “fix” for the problem, but it never made it into the “official” version (this was PRIOR to my joining the Program O team). It’s been a very long time (for me, at least) since I’ve seen that bit of code, so it’s going to take me some time to locate it, but I’ll find it, and post it here.

There’s a good chance that the bug fix may have been posted in the Version 1 Forums, too (somewhere). It MIGHT be worth a look. smile

 

 
  login or register to react