[{
id: ‘pm_1P99eEIaeDnhsdNwEvu7QhFK’,
object: “payment_method”,
billing_details: [Object],
card: [Object],
created: 1713979822,
customer: null,
livemode: false,
type: ‘card’
},
…]
in the above object i want to convert the timestamp to date is there any way to convert the created instead of manually changing each and every field
i am using the https://www.npmjs.com/package/json-2-csv package if there is any built-in method to do that ?
data.forEach(item => {
item.created = moment(item.created).format('YYYY-MM-DD');
});
i tried the forEach method.
but i there is any built-in method for the json-2-csv i would like to use that ?
Sagar Chopda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.