0

I am getting wrong time from the server after posting update. I am using datetime function in the sql and Livestamp.js and Moment.js scripts.

CREATE TABLE `posts` (
  `id` int(11) NOT NULL,
  `userid` int(11) NOT NULL,
  `image` varchar(255) NOT NULL,
  `date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

Here is the example in the image, i have just posted the image but getting like 14 hours ago. getting wrong time

Imr An
  • 27
  • 7
  • Is your timezone UMT + or - 7? Might be a problem with sign in timezone conversion between server and JS – rypskar Jun 22 '17 at 08:35
  • My timezone is UTC+5.30 . – Imr An Jun 22 '17 at 08:38
  • Is your database and browser timezone the same? Have you seen how the time you send to the browser look so you can see if the problem is with getting the time or with displaying it? In general time and timezone is a pain to get in sync between db and browser... – rypskar Jun 22 '17 at 11:33

0 Answers0