]> git.mxchange.org Git - friendica-addons.git/blobdiff - dwpost/dwpost.php
Refactor datetime_convert() into Temporal::convert()
[friendica-addons.git] / dwpost / dwpost.php
index 42b1770e56d05ef72203a4f9f68d73aa40595912..3730aa2b01a78b92ba8dd3844f7696bdb467371e 100644 (file)
@@ -7,10 +7,12 @@
  * Author: Michael Johnston
  * Author: Cat Gray <https://free-haven.org/profile/catness>
  */
+
 use Friendica\Core\Addon;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
 use Friendica\Util\Network;
+use Friendica\Util\Temporal;
 
 function dwpost_install() {
        Addon::registerHook('post_local',           'addon/dwpost/dwpost.php', 'dwpost_post_local');
@@ -185,7 +187,7 @@ function dwpost_send(&$a,&$b) {
                $post = xmlify($post);
                $tags = dwpost_get_tags($b['tag']);
 
-               $date = datetime_convert('UTC',$tz,$b['created'],'Y-m-d H:i:s');
+               $date = Temporal::convert($b['created'], $tz);
                $year = intval(substr($date,0,4));
                $mon  = intval(substr($date,5,2));
                $day  = intval(substr($date,8,2));