Clicky

ddmmyy
111255

it shoud be convert  before insert to mysql database in to feiild a(format date)

may be    '2011-12-11'  how can i convert it

budha calenda must minus 543 then it be come normal calendar

asked 12/10/2011 11:02

teera's gravatar image

teera ♦♦


2 Answers:
Try this:

1:
2:
3:
4:
5:
6:
7:
$budhadate = '111255';
preg_match('/^(d{2})(d{2})(d{2})$/', $budhadate, $matches);
$budhayear = $matches[3]+2500;
$yyyy = $budhayear - 543;
$mm = $matches[2];
$dd = $matches[1];
$date = "{$yyyy}-{$mm}-{$dd}";
link

answered

StingRaY's gravatar image

StingRaY

1:
insert into table1(a) values( str_to_date( concat(left('111255',4),right('111255',2)+2500-543), '%d%m%Y') )
link

answered 2011-12-10 at 21:41:20

gnoon's gravatar image

gnoon

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

Asked: 12/10/2011 11:02

Seen: 257 times

Last updated: 12/10/2011 02:53