Skip to content

Instantly share code, notes, and snippets.

@bradheintz
Created August 3, 2009 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradheintz/160763 to your computer and use it in GitHub Desktop.
Save bradheintz/160763 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Date to Day Converter</title>
</head>
<body>
<p><b>Instructions:</b> Enter a date in MM/DD/YYYY format, get back a day number from 1 to 366.</p>
<?php
if (isset($_POST['fromdate'])) {
$dt = new DateTime($_POST['fromdate']);
echo $_POST['fromdate']." is ".(date_format($dt, 'z') + 1)."<br/>\n";
}
?>
<hr>
<form target="<?php echo $PHP_SELF; ?>" method="POST">
<input type="text" name="fromdate"><br />
<input type="submit" name="convertit" value="Convert It">
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment