How to Automatically Display Today's Date on a SharePoint Page
Question details
The user wants to find a way to dynamically show the current date in a header or text area on a modern SharePoint page.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Designing a SharePoint site page and attempting to insert an element that automatically updates to reflect today's date whenever a visitor opens the page.
- Observed behavior
- Modern SharePoint pages do not include a standard, built-in web part to dynamically display the current date out of the box.
Verify if you have site owner or SharePoint admin permissions, as adding custom scripts or deploying new web parts to display dynamic dates requires elevated access to the site's App Catalog.
Develop a Custom SPFx Web Part
Since modern SharePoint lacks a built-in date web part, building a custom widget using the SharePoint Framework (SPFx) is the standard method for developers.
Modern SharePoint architecture restricts the injection of arbitrary JavaScript via Content Editor web parts for security reasons. To achieve dynamic content like today's date, developers must package a custom solution.
This requires knowledge of Node.js, TypeScript, and the SharePoint Framework.
Install Node.js, a code editor like VS Code, and the Yeoman SharePoint generator by running 'npm install -g @microsoft/generator-sharepoint' in your terminal.
Run 'yo @microsoft/sharepoint' to scaffold a new web part. Select 'WebPart' as the component type and choose React or No JavaScript Framework.
In your web part's render method or React component, use standard JavaScript like 'const today = new Date().toLocaleDateString();' and insert it into your HTML output.
Run 'gulp bundle --ship' and 'gulp package-solution --ship'. Upload the generated .sppkg file to your SharePoint tenant's App Catalog.
Edit your modern SharePoint page, click the '+' icon to add a new web part, and select your newly deployed Date web part.

Consult the Microsoft Q&A Community
If you lack development resources, consulting SharePoint customization specialists in official forums can help you find pre-built scripts or workarounds.
Manage Your Downloaded SharePoint Documents with WPS Office
While advanced page formatting in SharePoint requires custom development, managing the Office documents stored in your SharePoint libraries shouldn't be difficult. WPS Office is a free, lightweight, and fast alternative to Microsoft Office that lets you effortlessly open, edit, and save DOCX, XLSX, and PPTX files.
- 1. Download the installer: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install WPS Office: Run the downloaded setup file and follow the on-screen prompts to complete the installation.
- 3. Open SharePoint files seamlessly: Download any document from your SharePoint document library and open it directly in WPS Office to begin editing.

Frequently Asked Questions
Can I use a Script Editor web part to show the date on a modern SharePoint page?
By default, modern SharePoint pages do not support the classic Script Editor or Content Editor web parts for security reasons. However, an administrator can deploy the community-driven 'Modern Script Editor' SPFx web part, which would allow you to inject simple JavaScript to show the date.
Are there third-party SharePoint web parts available for displaying the date?
Yes, you can browse the SharePoint Store (AppSource) for clock or date web parts created by third-party vendors. Many of these can be added directly to your modern pages without needing custom code.
Can I use a calculated column to show today's date?
Yes, but this only applies to SharePoint Lists and Libraries, not page content. You can use the formula [Today] in a calculated column or view filter to track dates on list items, but this cannot be placed in a standard page header.




