RSS Feed/News Sanity Check on setting date and time

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
23,667
Points
823

Reputation:

Hi,

I am having some trouble with setting a timestamp. it seems to be setting the timestamp ahead of where it should be. As in I set it with the users timezone, but then read with my timezone it is taking that as a GMT time stamp and setting that.

The Code I am using is

PHP:

Code:
$tz = new \DateTimeZone(\XF::visitor()->timezone);
            $theDate = $this->custom_fields->endDate." ".$this->custom_fields->end_time.":00";
            $dateTime = new \DateTime($theDate, $tz)...

Read more

Continue reading...
 
Status
Not open for further replies.
Top