Getting only date or time is not possible

nativescriptcore
android

#1

im using kinvey db to store data & when i run this

console.log( metadata.lastModified );

i will get result like

JS: Sat Sep 01 2018 11:43:40 GMT+0530 (IST)
JS: Sat Sep 01 2018 11:49:18 GMT+0530 (IST)
JS: Sat Sep 01 2018 18:09:03 GMT+0530 (IST)
JS: Sat Sep 01 2018 18:38:06 GMT+0530 (IST)
JS: Sat Sep 01 2018 18:48:13 GMT+0530 (IST)
JS: Sat Sep 01 2018 18:52:37 GMT+0530 (IST)
JS: Sat Sep 01 2018 18:56:08 GMT+0530 (IST)

here i want only date . how to get only date or time without GMT… ?


#2

You have to parse the date.

https://www.w3schools.com/js/js_date_methods.asp

https://momentjs.com/docs/