diff --git a/packages/strapi-helper-plugin/lib/src/utils/dateToUtcTime.js b/packages/strapi-helper-plugin/lib/src/utils/dateToUtcTime.js index e13990c10c..a97fbe6bcc 100644 --- a/packages/strapi-helper-plugin/lib/src/utils/dateToUtcTime.js +++ b/packages/strapi-helper-plugin/lib/src/utils/dateToUtcTime.js @@ -1,5 +1,5 @@ import moment from 'moment'; -const dateToUtcTime = date => moment(date).utc(); +const dateToUtcTime = date => moment.parseZone(date).utc(); export default dateToUtcTime; diff --git a/packages/strapi-plugin-content-manager/admin/src/components/CustomTable/Row.js b/packages/strapi-plugin-content-manager/admin/src/components/CustomTable/Row.js index ffa8116f30..593acd41fa 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/CustomTable/Row.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/CustomTable/Row.js @@ -3,7 +3,7 @@ import { withRouter } from 'react-router'; import PropTypes from 'prop-types'; import { get, isEmpty, isNull, isObject, toLower, toString } from 'lodash'; import moment from 'moment'; -import { dateToUtcTime, IcoContainer, useGlobalContext } from 'strapi-helper-plugin'; +import { IcoContainer, useGlobalContext } from 'strapi-helper-plugin'; import useListView from '../../hooks/useListView'; import dateFormats from '../../utils/dateFormats'; import CustomInputCheckbox from '../CustomInputCheckbox'; @@ -37,7 +37,7 @@ const getDisplayedValue = (type, value, name) => { const date = value && isObject(value) && value._isAMomentObject === true ? JSON.stringify(value) : value; - return dateToUtcTime(date).format(dateFormats[type]); + return moment(date).format(dateFormats[type]); } case 'password': return '••••••••';