Can any one guide me how to convert the nepali date of database in to english date.
Database is here:
id date
1 2071/12/21
2 2071/9/15
Can any one guide me how to convert the nepali date of database in to english date.
Database is here:
id date
1 2071/12/21
2 2071/9/15
So, as far as the formula itself goes, it's described here: http://www.mypatro.com/date-converter.html
If you tell us what language are you trying to convert it in (programming language and \ or SQL dialect, such as MySQL, MSSQL etc) I can try and help converting the formula to an actual code.
EDIT:
Assuming $result contains your sql results;
$formatted_data = array();
while ($row = pg_fetch_assoc($result)) {
$nepali_date = strtotime($row['date']);
$english_date = strtotime("-56 years 8 months 16 days",$nepali_date)
$formatted_data['english_date'] = $english_date;
}
To make an approximate conversion, subtract 56 Years, 8 Months and 16 Days:
select
id,
date - interval '56 year'
- interval '8 month'
- interval '16 day' as date
from mytable
Again converting the strotime in to formated date:
$date['age'] = date("Y/m/d",$english_date);