diff --git a/src/Converter.php b/src/Converter.php index e2b8da2..8208a21 100644 --- a/src/Converter.php +++ b/src/Converter.php @@ -39,7 +39,7 @@ public function toFormattedDateString() * * @return string */ - public function toFormattedDayDateString(): string + public function toFormattedDayDateString() { return $this->format('l j F Y'); } @@ -68,6 +68,18 @@ public function toDateTimeString($unitPrecision = 'second') return $this->format('Y/m/d ' . static::getTimeFormatByPrecision($unitPrecision)); } + /** + * Format the instance as a readable date and time + * + * @param string $unitPrecision + * + * @return string + */ + public function toFormattedDateTimeString($unitPrecision = 'second') + { + return $this->format('j F Y ' . static::getTimeFormatByPrecision($unitPrecision)); + } + /** * Return a format from H:i to H:i:s.u according to given unit precision. * @@ -110,11 +122,23 @@ public function toDateTimeLocalString($unitPrecision = 'second') /** * Format the instance with day, date and time * + * @param string $unitPrecision + * + * @return string + */ + public function toDayDateTimeString($unitPrecision = 'second') + { + return $this->format('l j F Y ' . static::getTimeFormatByPrecision($unitPrecision)); + } + + /** + * Format the instance with the year, and a readable month + * * @return string */ - public function toDayDateTimeString() + public function toFormattedMonthYearString() { - return $this->format('l j F Y g:i A'); + return $this->format('F Y'); } }