Ash Ash - 6 months ago 31
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

So, as far as the formula itself goes, it's described here:

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.


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;