Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Run Embedded C# Pad on a web page
<!DOCTYPE html>
<meta charset="utf-8">
<title>Embedded C# Pad code example</title>
<code class="codepad language-csharp" data-codepad="theme:cobalt" style="width:100%;height:400px;" >//
// This program shows how long ago C# Pad ( was released.
// This source:,output
var releaseDate = new DateTime(2014, 2, 26, 6, 15, 0, DateTimeKind.Utc);
var span = DateTime.UtcNow - releaseDate;
Console.WriteLine("It's been {0} years, {1} months, {2} days, {3} hours, {4} minutes, {5} seconds since C# Pad was released!",
Math.Floor(span.Days / 365.25f), Math.Floor((span.Days % 365.25f) / 30f), (span.Days % 365.25f) % 30f, span.Hours, span.Minutes, span.Seconds )
<script src="//"></script>
<script type="text/javascript"> Codepad.all(); </script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.