Advertisement

ASP.net - Get 'page last updated/changed/modified on' time

On some pages it's necessary to display the 'Page Last Modified/Changed/Updated' Time. Here's one way to do it in ASP.net

//Code to display the 'page last modified/updated' time - SaturnVibes.com
// Get the path of the .aspx file.

// Get the last updated Server Time

// Get the last updated time in UTC

// The above DateTime value will contain the time when the file was last updated.
// Use this value in a label this way: