Location: PHPKode > scripts > TinyDateHelper > tinydatehelper/example.php
<?php
	/* the description________________________________________
	*
	*	this class converts ie:
	*	
	*	6,7			-> 06.07.2003 (expands with actual year)
	*	6,7,99		-> 06.07.1999
	*	6.7			-> 06.07.2003 
	*	06,07		-> 06.07.2003 
	*	06-07-03	-> 06.07.2003 
	*	6sjdfh7sjdk	-> 06.07.2003 
	*	... and any combination of the above to the right date
	*
	*	it returns:
	*
	* 	the input string	: 6,7,03
	*	day,month,year		: 06 07 1999 (seperatly)
	*	timestamp			: 1057442400
	*	mysql timestamp		: 2003-07-06	
	*	true or false
	* 	if false an error message
	*	______________________________________________________
	*
	*	this class maybe usefull in dateforms for quickly 
	*	insert date with the keypad,
	*	or for custumers with huge fingers 
	*
	* 	____________________________________________________*/
	
	
	include("tinydatehelper.php");
	
	if(isset($submit))
	{
		
		$d = new tdh();
		if($d->MakeDate($HTTP_POST_VARS["userdate"])){
			echo $d->string."<br>";
			echo $d->day."<br>";
			echo $d->month."<br>";
			echo $d->year."<br>";
			echo $d->date."<br>";
			echo $d->timestamp."<br>";
			echo $d->mysql_stamp."<br>";
		} else {
			echo $d->error;
		}
	
	}
	
?>
<HTML>
<HEAD>
</HEAD>
<BODY>
<FORM action="<?php echo basename($PHP_SELF); ?>" method="post" name="datum">
<INPUT type="text" name="userdate" value="<?php echo $HTTP_POST_VARS["userdate"]; ?>">
<INPUT type="submit" name="submit" value="submit">
</FORM>
</BODY>
Return current item: TinyDateHelper