Not sure exactly where pub_date comes from, but I’m pretty sure it reflects the date the document is due to be published, and it is zero (interpreted as a date of 01/01/1970) unless someone or something sets it otherwise. You could use the editedon field instead of pub_date if you want a date that is automatically set for "last modified", or createdon if you want a static date. There is also a publishedon field in the documentObject, which appears to be set automatically when the document is published
<?php
$value=$modx->documentObject['editedon']; //// createdon, publishedon /////
$tgl=strftime("%d/%m/%Y",$value);
return $tgl;
?>

KP