nitishrajuprety/nepalidateconverter

将公历日期转换为巴克塔·萨瓦特日期,反之亦然。

1.0.0 2018-02-01 18:01 UTC

This package is not auto-updated.

Last update: 2024-09-29 05:34:57 UTC


README

将公历日期转换为巴克塔·萨瓦特日期,反之亦然。

安装

composer require nitishrajuprety/nepalidateconverter

使用

公历到巴克塔·萨瓦特

$nepaliDateConverter = new NepaliDateConverter(lang);

$date = $nepaliDateConverter->toNepali(yyyy, mm, dd);

或者

$date = toNepali(yyyy, mm, dd, lang);

返回一个包含转换值的数组。



巴克塔·萨瓦特到公历

$nepaliDateConverter = new NepaliDateConverter(lang);

$date = $nepaliDateConverter->toEnglish(yyyy, mm, dd);

或者

$date = toEnglish(yyyy, mm, dd, lang);



如果没有为 lang 提供参数,则返回英文值。可能的值是 'ne'(尼泊尔语)或 'en'(英语)。所有传递的参数都必须使用英语。