Ash Ash - 1 year ago 129
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 Source

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;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download