PHP code example of vladshoko / bitrix-datetime-converter
1. Go to this page and download the library: Download vladshoko/bitrix-datetime-converter library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vladshoko / bitrix-datetime-converter example snippets
$converter = new \Vladshoko\BitrixDateTimeConverter\Converter\DateTimeConverter();
$source = new \DateTimeImmutable('now', new \DateTimeZone('UTC'));
$bitrixDateTime = $converter->toBitrixDateTime($source);
$converted = $converter->fromBitrixDateTime(
$bitrixDateTime,
new \DateTimeZone('UTC')
);