Skip to content
Snippets Groups Projects
Commit 09458aa6 authored by Robin Appelman's avatar Robin Appelman
Browse files

add dateOnly option to formatDate

parent c1d02fd1
No related branches found
No related tags found
No related merge requests found
......@@ -232,10 +232,11 @@ class OC_UTIL {
/**
* formats a timestamp in the "right" way
*
* @param timestamp $timestamp
* @param int timestamp $timestamp
* @param bool dateOnly option to ommit time from the result
*/
public static function formatDate( $timestamp ){
$timeformat='F j, Y, H:i';
public static function formatDate( $timestamp,$dateOnly=false){
$timeformat=$dateOnly?'F j, Y':'F j, Y, H:i';
return date($timeformat,$timestamp);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment