mirror of
https://github.com/dwaxweiler/connector-mobilizon
synced 2025-06-05 21:59:25 +02:00
13 lines
363 B
PHP
13 lines
363 B
PHP
<?php
|
|
namespace MobilizonConnector;
|
|
|
|
final class LocalDateTimeFormatter
|
|
{
|
|
public static function format(LocalDateTime $dateTime, string $format) {
|
|
$timestamp = $dateTime->getValue()->getTimestamp();
|
|
$offset = $dateTime->getValue()->getOffset();
|
|
$timestampWithOffset = $timestamp + $offset;
|
|
return date_i18n($format, $timestampWithOffset);
|
|
}
|
|
}
|