Bacancy Technology
Bacancy Technology represents the connected world, offering innovative and customer-centric information technology experiences, enabling Enterprises, Associates and the Society to Rise™.
12+
Countries where we have happy customers
1050+
Agile enabled employees
06
World wide offices
12+
Years of Experience
05
Agile Coaches
14
Certified Scrum Masters
1000+
Clients projects
1458
Happy customers
Artificial Intelligence
Machine Learning
Salesforce
Microsoft
SAP
October 9, 2023
The Date object has various methods for creating a date as string in special formats.
Few of them are below:
toDateString() – Fri Sep 22 2023,
toLocaleDateString() – 22/09/2023,
toString() – Fri Sep 22 2023 19:11:23 GMT+0530 (India Standard Time) and so on.
import React, { useState } from "react"; export default function App() { const [date, setDate] = useState(new Date()); return <p>Date: {date.toDateString()}</p>; } // Result // Date: Fri Sep 22 2023