Converts the date string $str to another format. The date format is Y-m-d, or Unix timestamp format. The default $fmt is Y-m-d.