-1

ACTUAL TIME IS 2023-02-24T04:34:39.884+05:30 CURRUNT TIME 2023-02-24T10:16:13+05:30 DIFFERANCE B/W TWO DATES 18:18:26

but actual result according to above is 6 hours, so this is wrong time 18:18:26 occur. How to check formate date also means DD:MM:YY HH:mm:ss can you tell me how to fix it?

riddhi
  • 7
  • 2
  • you need to share the code which is producing the wrong output so that we can help you to fix it, any way please check if this [helps](https://blog.bitsrc.io/calculate-the-difference-between-two-2-dates-e1d76737c05a) – vignesh Feb 24 '23 at 06:28
  • Does this answer your question? [How to calculate number of days between two dates?](https://stackoverflow.com/questions/542938/how-to-calculate-number-of-days-between-two-dates) – DarkBee Feb 24 '23 at 08:16

1 Answers1

-1

use moment or dayjs to change and update date and time formate according to your requriemnt

yarn add moment || yarn add dayjs

  moment().formate('DD:MM:YY HH:mm:ss') // pass 'DD:MM:YY HH:mm:ss' in formate('') to get date in this formate 

if you have want to formate specific date then pass in moment()

let date = 2023-02-24T04:34:39.884+05:30

moment(date).formate('DD:MM:YY HH:mm:ss')
ravin kumar
  • 92
  • 1
  • 5