Bangladeshi Softwares
Home - Download - Codes & Tutorials - Bangla IT Bibhag - Mobile - About Me

 


Custom function for modified page in JavaScript


Step-1:
This is a customized version of JavaScript's document.lastModified property. Please note that not all web servers are required to provide the timestamp. If your web server is not going to provide this information for you, calling this function may display incorrect timestamp. Open your favorite text editor and type the code below:


<script language="javascript" type="text/javascript">
<!--

/*
 * Author: Ahsanul Haque Shovon
 * Email: ahsanul.haque.shovon@gmail.com / ahsanul_haque_shovon@yahoo.com
 * Web: http://shovon.110mb.com
 */

/*************************************************
 * This function will serve you the full date and
 * time when document was last saved.
 *************************************************/
function full_modify_date()
{
  var day = new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');

  var mon = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul',
                      'Aug','Sep','Oct','Nov','Dec');

  date = new Date(document.lastModified);
  temp = date.getDay();
  dt = day[temp];
  dt += ', ' + date.getDate();
  temp = date.getMonth();
  dt += ' ' + mon[temp];
  dt += ' ' + date.getFullYear();
  dt += ', ' + date.getHours();
  dt += ':' + date.getMinutes();
  dt += ':' + date.getSeconds();

  document.write(dt);
}

//-->
</script>


Step-2:
Now call the full_modified_date() function anywhere in the document body between the <SCRIPT> and </SCRIPT> tags. You can also save the function as an external JavaScript file and link the file whenever you need.

Page last updated at:


Other Helpful Resources:
http://javascript.internet.com
http://www.planetsourcecode.com



 



©Ahsanul Haque Shovon
All rights reserved