moment js not showing local time it’s showing same in the Database

how to display createdAt field date according to the local timezone. i have tried it’s only working for localhost when I upload it on the server it’s showing createdAt field data UTC format.

here is my code

dateFormatwithSec(date_time) {

    const testDateUtc = moment.utc(date_time);
    const localDate = moment(testDateUtc).local();
    return localDate.format('YYYY-MM-DD HH:mm:ss');
},

why it’s not providing the right output on the server.