I have created a layout page and want to show last modified date (without time) of page
Using below to show last modified date but it is displaying time also
<SharePointWebControls:DateTimeField FieldName="Modified" runat="server" />
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI have created a layout page and want to show last modified date (without time) of page
Using below to show last modified date but it is displaying time also
<SharePointWebControls:DateTimeField FieldName="Modified" runat="server" />
We can use JavaScript to remove time from Modified date as below sample code
<div class="page-content-footer container">
<p class="date" id="mslastModifiedDateOnly">Last Reviewed:
<SharePointWebControls:DateTimeField FieldName="Modified" runat="server" />
</p>
<script>
jQuery(document).ready(function () {
jQuery('#mslastModifiedDateOnly').text('Last Reviewed: '+ jQuery('#mslastModifiedDateOnly').text().replace('Last Reviewed: ','').split(' ')[0]);
});
</script>
<hr>
<div id="pageFeedbackForm" class="form">
<!-- COMPONENT - Page Feedback -->
</div>
</div>
DateOnly
attribute totrue
. Try it as<SharePointWebControls:DateTimeField FieldName="Modified" DateOnly="true" runat="server" />
and check – Gautam Sheth Feb 15 '19 at 10:57DateOnly="True"
orDateOnly="TRUE"
and check ? You can also try it as<SharePointWebControls:DateTimeField FieldName="Modified" DateOnly="true" EnableViewState="true" runat="server" />
? – Gautam Sheth Feb 15 '19 at 11:03