SharePoint Document Issues

How to Automatically Display Today's Date on a SharePoint Page

Ayan MasoodAyan Masood Nov 3, 2026 868 views

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.

How to Display Today's Date Automatically on a 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.
Before you start

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.

Solution 1Recommended

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.

1
Set up your development environment

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.

2
Create a new SPFx project

Run 'yo @microsoft/sharepoint' to scaffold a new web part. Select 'WebPart' as the component type and choose React or No JavaScript Framework.

3
Add the date logic

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.

4
Build and deploy the package

Run 'gulp bundle --ship' and 'gulp package-solution --ship'. Upload the generated .sppkg file to your SharePoint tenant's App Catalog.

5
Add the web part to your page

Edit your modern SharePoint page, click the '+' icon to add a new web part, and select your newly deployed Date web part.

Develop a Custom SPFx Web Part
No Developer Access?: If you do not have permission to deploy SPFx solutions, you will need to contact your IT administrator or look for an alternative approach.
Free Microsoft Office alternative

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. 1. Download the installer: Visit the official WPS Office website and click the free download button for your operating system.
  2. 2. Install WPS Office: Run the downloaded setup file and follow the on-screen prompts to complete the installation.
  3. 3. Open SharePoint files seamlessly: Download any document from your SharePoint document library and open it directly in WPS Office to begin editing.
Fully compatible with Microsoft Office formats (Word, Excel, PowerPoint) downloaded from SharePointFree and lightweight software that won't slow down your computerFamiliar user interface for a seamless transition with zero learning curveBuilt-in PDF reader and editor for comprehensive document management
microsoft office alternative - wps office

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.