Modifications to Your .emacs File

Make the following changes to the .emacs file in your home directory in order to change the timestamp format for the CTC web pages.

What to change …

Find the following code in your .emacs file:

	     (defun html-helper-insert-timestamp ()
	       "Timestamp insertion function"
	       (insert "This page was last modified "
		       (format-time-string
			"%A, %e %B %Y at %H:%M UTC."
			(current-time)
			t)
		       "\n"))

Change the two lines emphasized above in red as follows:

	     (defun html-helper-insert-timestamp ()
	       "Timestamp insertion function"
	       (insert "This page was last modified "
		       (format-time-string
			"%A, %B %e, %Y."
			(current-time)
			nil)
		       "\n"))

What's going on …

Changing the string will give us a timestamp in the format Weekday, Month Day, Year.

By changing t to nil, the time zone used for the timestamp is changed from UTC (actually, GMT on our system!) to the local time zone (currently, EDT). Although we're not stamping the time, this will keep the date correct for editing in our time zone.

More information …

If you want to make further changes to your timestamp function, consult the GNU Emacs Lisp Reference Manual, in particular sections 40.5 Time of Day and 40.6 Time Conversion.


[ Return to the CPSCI 107 homepage ]

Brian J. Rosmaita <contact me>
This page was last modified Thursday, 4 May 2006 at 18:37 UTC.
Valid XHTML 1.0 ! Valid Cascading Style Sheets!