Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

easiest way to show current date in react

import React from "react";

// Rearrange date value to get the order you want... also replace / with a cooler separator like ⋅
export default function App() {
  const current = new Date();
  const date = `${current.getDate()}/${current.getMonth()+1}/${current.getFullYear()}`;

  return (
    <div className="App">
      <h1>Current date is {date}</h1>
    </div>
  );
}
 
PREVIOUS NEXT
Tagged: #easiest #show #current #date #react
ADD COMMENT
Topic
Name
8+7 =