note 69691 deleted from function.date by danbrown

From: Date: Sun, 20 Jul 2008 02:55:23 +0000
Subject: note 69691 deleted from function.date by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-142001@lists.php.net to get a copy of this message
Note Submitter: mandi tek shqiperia.com ---- If you have a date in the english format"Thu Sep 07 23:59:35 CEST 2006" (some times generated from logs or other systems) and you need to translate it in mm/dd/yyyy you can use the following function! //$data="Thu Sep 07 23:59:35 CEST 2006"; function formadatedb($data) { $dt=explode(" ", $data); $year=array ("Jan"=>1, "Feb"=>2, "Mar"=>3, "Apr"=>4, "May"=>5, "Jun"=>6, "Jul"=>7, "Aug"=>8, "Sep"=>9,"Oct"=>10,"Nov"=>11,"Dec"=>12); return $year[$dt[1]]."/".$dt[2]."/".$dt[5]; }

« previous php.notes (#142001) next »