PHPBuilder - mysql Timestamp(14) to .beat



RSS Twitter
Snippets Calendars Dates

mysql Timestamp(14) to .beat

by: Dominik Nufer
|
March 6, 2001

Version: 0.0.1

Type: Sample Code (HOWTO)

Category: Calendars/Dates

License: GNU General Public License

Description: simple code converts a mysql timestamp(14) to swatch .beat



if ( ereg( "([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})", $row["time"], $regs ) ) {
	$date= "$regs[3].$regs[2].$regs[1]";
	$time=floor(($regs[4]*60+$regs[5]+$regs[6]/60)/(24*60)*1000);
	if($time<100){
		$time="0".$time;
	}
} 

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Dominik Nufer

Comment:



Comment:

(Maximum characters: 1200). You have characters left.