The fact that you started with a new data file explains the reason for the odd time return, as the script needs a $ctime value from the data.
Since the data file is new, then the value the script is using, apparently, is 0.

Try with the older data file, as I can see no reason for it to not work, and have used a similar script myself for years.

You'll probably want to edit the $asctime to include formatting preferences to get the display in the order you want.
See /help $asctime for details.