Ash Ash - 2 months ago 10
MySQL Question

How to convert nepali date of database in to english date?

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

Noy Noy
Answer

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;
}
Comments