Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Reading backend data, ISO format date

I get data from the backend that look like that

start: '2022-10-22T00:00:00Z, end: '2022-10-26T00:00:00Z

regarding the discount of a product. So that basically means that the product is discounted until 25.10.22 until 23.59, right? Thought it would be until 26.10.22 until 23.59 and got a bit confused. Thank you!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

It’s precisely what it is.

from 2022-10-22@12am to 2022-10-26@12am

You should use the provided date as is, but I suggest you convert it first to milliseconds before comparing.

There are plenty of well-maintained packages out there that can do the work for you, be it composer or npm, where you’ll just have to supply the dates.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading