SharePoint - Add time on SharePoint 2007 page

Hi
I'm pretty new to SharePoint page updates and i'm trying to add the date and time on the page.

I'm already using the below code but how can i add the time?

Thanks for your help.
<label id="Label1">Team Metrics:  <script type="text/javascript">  
   update = new Date(document.lastModified)  
theMonth = update.getMonth() + 1  
theDate = update.getDate()  
theYear = update.getFullYear()  
document.writeln("Page last modified: " + theDate + "/" + theMonth + "/" + theYear)</script>

Open in new window

LVL 11
Wilder1626Asked:
Who is Participating?
 
Rainer JeschorCommented:
Hi,
if document.lastModified contains the complete datetime then it should be
<label id="Label1">Team Metrics:  <script type="text/javascript">  
   update = new Date(document.lastModified);  
theMonth = update.getMonth() + 1;  
theDate = update.getDate();  
theYear = update.getFullYear();
theHours =  update.getHours();
theMinutes = update.getMinutes();
theSeconds = update.getSeconds(); 
document.writeln("Page last modified: " + theDate + "/" + theMonth + "/" + theYear + " " + theHours + ":" + theMinutes + ":" + theSeconds);</script>

Open in new window

HTH
Rainer
0
 
Wilder1626Author Commented:
Thanks Rainer

this is exactly what i was looking for.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.