note 31202 deleted from function.strtotime by sniper

From: Date: Tue, 21 Oct 2003 11:02:18 +0000
Subject: note 31202 deleted from function.strtotime by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-59003@lists.php.net to get a copy of this message
Note Submitter: irmak @ okulyillari.com ---- I came up with a new solution to convert UK date format such as dd-mm-YYYY or (-) separeted date formats into UNIX. Here it is.. <?php $uk_date = ("15-12-2021"); //first we define a date in uk format , this can also be a passed variable $uk_date=str_replace("-01-", " January ", $uk_date); $uk_date=str_replace("-02-", " February ", $uk_date); $uk_date=str_replace("-03-", " March ", $uk_date); $uk_date=str_replace("-04-", " April ", $uk_date); $uk_date=str_replace("-05-", " May ", $uk_date); $uk_date=str_replace("-06-", " June ", $uk_date); $uk_date=str_replace("-07-", " July ", $uk_date); $uk_date=str_replace("-08-", " August ", $uk_date); $uk_date=str_replace("-09-", " September ", $uk_date); $uk_date=str_replace("-10-", " October ", $uk_date); $uk_date=str_replace("-11-", " November ", $uk_date); $uk_date=str_replace("-12-", " December ", $uk_date); $newdate = strtotime($uk_date); echo $newdate; // this value will give us unix time format such as 1639544400 ?> I hope it helps someone

« previous php.notes (#59003) next »