Skip Navigation Links 

U of A University Information Technology Services

Was this page helpful?
 [+]





...Or log into AskIT
and request help.

 

Display Current or Last Modified Date

To automatically show the current date or last modified date on a web page, place a server side include (SSI) in the HTML code where you would like the date to appear on the page.

  • Copy and paste or type the SSIs from this page into the code of your file.
  • Use caution with HTML editors; some will, upon editing and uploading your file, remove all SSIs from the file and replace them with the static (non-changing) text result of the SSI.
  • You can use SSH Secure Shell for Windows or Macintosh SSH to log into your account and edit your file with Pico.

To have the last modified date of your file (the last time you edited your file) appear on the web page, use the following SSI:

<!--#echo var="LAST_MODIFIED"-->

The date will be formatted as:
Tuesday, 11-Nov-03 08:52:03

To have the current date and time appear on your Web page, use the following SSI:

<!--#echo var="DATE_LOCAL"-->

The date will be formatted as:
Tuesday, 11-Nov-03 08:52:03 CST

To change the format of the date and/or time that appears on your page when using one of these SSIs, place the following line of code above the date/time SSI in the file and replace the elipsis (...) with a combination of the time format codes in the Time Formats table below and add any desired punctuation. (ex. %A:%B will result in Day:Month) 

<!--#config timefmt="..."-->

Time Formats

Code Definition
%a day of week abbrev
%A day of the week
%b month name abbrev
%B month name
%d date
%D date as m/d/y
%e date (2 digits)
%H 24 hour clock hour
%I 12 hour clock hour
%j decimal day of the year
%m month number
%M minutes
%p am/pm
%r time as hour/min/sec/am/pm
%S seconds
%T 24 hour time as hour/min/sec
%U week of the year
%W week of the year
%w day of the week number
%y year of the century
%Y year
%Z time zone

 

 

Thank you for visiting UITS. This page can be found at:
http://uits.uark.edu/web/index_4762_ENG_HTML.htm