-
-
Save csharpfritz/f2df364a6cbdaeaa8f126533b08c2755 to your computer and use it in GitHub Desktop.
Razor Functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@page | |
@functions { | |
public string FormatDate(DateTime theTime) { | |
return theTime.ToString("d"); | |
} | |
} | |
<html> | |
<body> | |
<h2>The server-local time now is:</h2> | |
<p>@FormatDate(DateTime.Now)</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment