Here is an example with a RTC
http://www.picbasic.co.uk/forum/showthread.php?t=12671

But the problem might be with the placement of the [ ]

Showing your whole code may also help. Where is the data coming from?