Pascific time code example
Example 1: php ping time
<?php
$ip_address = '123.456.789.0'; // IP address you'd like to ping.
exec("ping -c 1 " . $ip_address . " | head -n 2 | tail -n 1 | awk '{print $7}'", $ping_time);
print $ping_time[0]; // First item in array, since exec returns an array.
?>
Example 2: shell script current time
date +'FORMAT'
### mm/dd/yyyy ###
date +'%m/%d/%Y'
## Time in 12 hr format ###
date +'%r'
## backup dir format ##
backup_dir=$(date +'%m/%d/%Y')
echo "Backup dir for today: /nas04/backups/${backup_dir}"