I am using ReactJs to create DateTime picker. Now my problem is how the date object converts to the moment object.
For example below is the date object, this object just show the value of date object:
Wed Sep 21 2022 00:17 GMT+0800 (Malaysia Time)
How can I convert to the moment object like below sample:
Moment {_isAMomentObject: true, _i: Wed Sep 21 2022 00:27:50 GMT+0800 (Malaysia Time), _isUTC: false, _pf: {…}, _locale: Locale, …}
_d
:
Wed Sep 21 2022 00:17:50 GMT+0800 (Malaysia Time) {}
_i
:
Wed Sep 21 2022 00:27:50 GMT+0800 (Malaysia Time) {}
_isAMomentObject
:
true
_isUTC
:
false
_isValid
:
true
_locale
:
Locale {_calendar: {…}, _longDateFormat: {…}, _invalidDate: 'Invalid date', _dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: ƒ, …}
_pf
:
{empty: false, unusedTokens: Array(0), unusedInput: Array(0), overflow: -2, charsLeftOver: 0, …}
[[Prototype]]
:
Object
I don't want to show the date object like the below picture:
Hope someone can guide me on how to solve this problem. Is possible to solve this? Thanks.

