Kurt6863778
Posts: 0
Joined: Sun May 11, 2014 2:15 am

wrong database item time

hey my database items list the wrong time that i add or update a record in database when i list the created at or updated at time . when i first used this feature it worked and actually matched my time on computer/pone but now it is 4 ours ahead of my time (Barbados) and i have not changed any time preferences here on my pone nor laptop .

or

is there a way i can just display the date only wen the item was added to database ? thanks

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

wrong database item time

Hi Kurt.

Appery.io using GMT as base time. See about GMT: http://en.wikipedia.org/wiki/Greenwic...

So, if you need you can convert this time to other one.

For example you can use following code to do it:

pre

var gmtDate = new Date("2014-04-15 00:32:22.883");

//Here is time zone offset you need to set it in accordace with your location.
var timeOffset = 2;
var localDate = new Date(gmtDate.getTime() + timeOffset * 3600 * 1000);

var dateString = localDate.getDate() + "-" + (localDate.getMonth() + 1) + "-" + localDate.getFullYear() + " " + localDate.getHours() + ":" + localDate.getMinutes();

console.log(dateString);

/pre

Regards.

Return to “Issues”