-1

Time format i have is 2022-02-16T12:33:44Z

How can is make this

2022-02-16

12:33 

including br tag.

what i tried was date.split("T") but don't know what to do next

2
  • 1
    You can try DateTimeFormat Commented Feb 16, 2022 at 14:06
  • You can easily achieve the desired behavior through simple String methods. Also, React has nothing to do with this, it's just plain old JavaScript. Commented Feb 16, 2022 at 14:31

1 Answer 1

0
const str = "2022-02-16T12:33:44Z"
str.split("T")[0]
str.split("T")[1].slice(0,-4)

Output

2022-02-16

12:33

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.