日期转农历
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
} dependencies {
compile 'com.github.loonggg:LunarCalendar:v1.0'
} //获取农历
Log.i("农历", LunarCalendar.getLunarYearMonthDay(2017, 5, 27));
//只获取农历的年份
Log.i("农历", LunarCalendar.getLunarYear(2017, 5, 27, true));
Log.i("农历", LunarCalendar.getLunarYear(2017, 5, 27, false));
//只获取农历的月日
Log.i("农历", LunarCalendar.getLunarMonthDay(2017, 5, 27));
//只获取农历的生肖
Log.i("农历", LunarCalendar.getLunarAnimal(2017, 5, 27));欢迎大家关注我的微信公众号:非著名程序员(smart_android),更多好的原创文章均首发于微信订阅号:非著名程序员
Copyright 2016 loonggg
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.