Home > OS >  How to get start and end timestamps of every month in selected year
How to get start and end timestamps of every month in selected year

Time:09-23

so i have timestamp for the begining of the year (Friday, 1 January 2021 00:00:00) and end of the year( Friday, 31 December 2021 23:59:59 )

{ yearStart: 1609455600000, yearEnd: 1640991599000 }

because i need to get data for every month in this year i need start and end timestamps of a month. is there any method for this? ty in advance

CodePudding user response:

I suggest to use a date and time module. For example enter image description here

  • Related