$date = new Zend_Date(); $format = 'Y-m-d'; echo $date->toString($format);
$time = new Zend_Date(); $format = 'H:i:s'; echo $time->toString($format);In this example, a Zend_Date object is created for the current time, and the time is converted to a string in the format 'H:i:s', which represents the hours, minutes, and seconds. The package library used for these examples is the Zend Framework, specifically the Zend_Date component.