reversing date
Posted: Mon Jul 23, 2007 11:22 pm
I need a function that turns dd-mm-yyyy to yyyy-mm-dd
thanks
thanks
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$str = "dd-mm-yyyy";
if(strstr('dd-mm-yyyy ',$str){$str = "yyyy-mm-dd"; }truepal20032001 wrote:if you find that in a regular string just do this
Code: Select all
$str = "dd-mm-yyyy"; if(strstr('dd-mm-yyyy ',$str){$str = "yyyy-mm-dd"; }
This should go in hall of fametruepal20032001 wrote:if you find that in a regular string just do this
Code: Select all
$str = "dd-mm-yyyy"; if(strstr('dd-mm-yyyy ',$str){$str = "yyyy-mm-dd"; }
truepal20032001 wrote:if you find that in a regular string just do this
Code: Select all
$str = "dd-mm-yyyy"; if(strstr('dd-mm-yyyy ',$str){$str = "yyyy-mm-dd"; }
It takes less than minute to try out both stuff...don't be so lazym2babaey wrote:I'm sure explode() and then using dots works ( have not tried)
But this code is so strange to me. will that work?truepal20032001 wrote:if you find that in a regular string just do this
Code: Select all
$str = "dd-mm-yyyy"; if(strstr('dd-mm-yyyy ',$str){$str = "yyyy-mm-dd"; }