views:

263

answers:

3

Is it possible to display the current date in the master.default page? I am running MOSS 3.0.

+1  A: 

Absolutely. master.default is executed in the context of an ASP.net (.aspx) page and you can use script within it by editing the markup to contain:

  <%=System.DateTime.Now %>

wherever you might need it.

Jesse C. Slicer
+3  A: 

If your MOSS configuration allows inline code blocks, you can simply write this into your default.master page:

<%= DateTime.Now.ToString() %>

For more information on enabling code blocks, you can check out this blog post by Nick Swan.

If you can not / do not want to enable code blocks, then a simple JavaScript solution might suffice:

<script type="text/javascript">document.write( new Date().toLocaleString() )</script>
CBono
A: 

Create a user control and deploy it as a Feature to the ControlTemplates folder. Use the control code-behind to return the date. There is an existing table cell on the top right of the publishing site home page where you can place it and give it enough space for the longest day of the week plus date :-)

IrishChieftain