Hi
Please any help me on the below issue
i am having a interger as below the formate is CYYDDD
114024
i want to change the above line as
24-01-2014
Hi
Please any help me on the below issue
i am having a interger as below the formate is CYYDDD
114024
i want to change the above line as
24-01-2014
use below
<?php
$a=114024;
echo date('d-m-Y',strtotime($a));
?>
<?php
function jde_date_conv($jde_date)
{
$ct = substr($jde_date,0,1);
$yr = substr($jde_date,1,2);
$dy = substr($jde_date,3,3);
if($ct == 0) $yr_pfx = 19;
if($ct == 1) $yr_pfx = 20;
$tlt_yr = $yr_pfx.$yr;
$base_time = mktime(0,0,0,1,0,$tlt_yr);
$unix_time = ($dy * 86400) + $base_time;
return date("d-m-Y" , $unix_time);
}
?>
Edit: you have shorter solution above.
Isn't this just a continuation of:
http://www.daniweb.com/web-development/php/threads/471807/how-to-leave-the-values-after-period-
A thread you seem to have abandoned btw.
Hi Tpojka
Thanks for your help
its working fine
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.