Code Monkey home page Code Monkey logo

ephemeris's Introduction

Kilofox Ephemeris

📅 千狐天文历是一款利用天文算法实现**农历与公历无表查询的日历产品,可用于西元前1000年至西元3000年期间的日期转换。

Installing

$ composer require kilofox/ephemeris

Usage

use Kilofox\Ephemeris\Calendar;

$calendar = new Calendar;

// 阳历转阴历
$result = $calendar->solar2lunar(2021, 3, 19);

// 阴历转阳历
$result = $calendar->lunar2solar(2021, 2, 7);

结果:

array (
  'lunar_year' => 2021,
  'lunar_month' => 2,
  'lunar_day' => 7,
  'lunar_year_chinese' => '二零二一',
  'lunar_month_chinese' => '二月',
  'lunar_day_chinese' => '初七',
  'cstb_year' => '辛丑',
  'cstb_month' => '辛卯',
  'cstb_day' => '丙寅',
  'is_leap' => true,
)

array (
  'solar_year' => 2021,
  'solar_month' => 3,
  'solar_day' => 19,
  'solar_hour' => 18,
  'solar_minute' => 21,
  'solar_second' => 7,
)

更多 API 见源码。

Reference

ephemeris's People

Contributors

kilofox avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.