两个手机的1987年农历阳历表一样阳历差十天怎么办

预产期是按照怀孕的月份农历算还要阳历算?因为农历和阳历相差十天!_百度宝宝知道阳历有两个一年??阳历两个一年与农历生肖对不上!!!【日历吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:812贴子:
阳历有两个一年??阳历两个一年与农历生肖对不上!!!收藏
今天无意中发现,阳历有两个一年,且与农历的十二生肖两个一年不一样???有图有真相,直接上图!!!!
政府办学,免学费入读大专+高级工双证教育,选择医药行业,成就辉煌未来.
后面那个是公元前1年
登录百度帐号推荐应用西西软件园多重安全检测下载网站、值得信赖的软件下载站!
→ 农历和阴历是怎么一回事 公历和阳历是怎么回事
类型:ios生活服务大小:380KB语言:中文 评分:5.0
很多朋友都不知道农历、阴历是怎么一回事,尤其是城市里的小孩,压根就没听说过农历这一说法。比如我们过年过中秋节等都是按照农历算的。通常所说的阴历也叫农历、夏历。是中国的一种历法,是阴阳历的一种,一般叫作阴历。平年十二个月,大月三十天,小月二十九天,全年354天或355天(一年中哪个月大,哪个月小,年年不同)。由于每年的天数比太阳年约差十一天,所以在十九年里设置七个闰月,有闰月的年份全年383天或384天。又根据太阳的位置,把一个太阳年分成二十四个节气,以利于农业种植等活动。纪年用天干地支搭配,六十年周而复始。这种历法相传创始于夏代,所以又称为夏历。也叫旧历。&公历称为“阳历”,民间的传统的“夏历”、“农历”通俗地称之为“阴历”。阳历是以地球环绕太阳一周的时间算作一年。它的长度为三百六十五天五小时四十八分四十六秒。由于它不是整数,为了把长短拉平,有的年份是三百六十六天,称为“闰年”;有的年份是三百六十五天,称为“平年”。阴历根据月亮圆缺变化的周期,即朔望月制定的。阴历的主要特点是:历月的长短依据天象即月相来确定,大月30日,小月29日。公历=阳历 &是世界通用的日期也就是我们平常的日期农历=阴历 &是我国古代用来农耕的日期,也就是日历下面的小字所表示的日期 1,阳历--以地球绕太阳一周为一年所定出的历法. 2,阴历--以太阴(月亮)绕地球为一个月,12个月为一年(闰年为13个月)所定出来的历法.(以闰月调节年之四时). 3,公历--世界各国通用的历法.为太阳历,即阳历. 4,夏历--中华历代所用的历法,始自夏代,故称.是阴历,历代都在不断修改,后来加上24节气后,成了阴阳合历. 5,农历--与夏历没有什么区别.历法为农事而立,所以中国人叫它农历.其中的24 节气是按太阳年24等分而得,这是阳历部分.农历的月日及闰法属于阴历部分,编在一起就成了和阴阳合历.我们平常没注意,叫惯了&阴历&不加区分. 农历和阴历的区别 1、阴历是农历,但农历不仅是阴历。我国自古流传下来的农历是阴阳合历,其中包括象这样“八月十五月亮圆”表示的以月亮周期记录的阴历。也包括“清明节”这样按“节气”来表达的、总在每年的4月5日这样的太阳历。 所以,经常会在日历上看到“农历七月初七,大暑第九日”这样的表示,前面的七月初七是农历中的阴历表示法,而大暑第九日则是农历中的阳历表示法。 2、从字面上理解,阳历是“太阳历”的简称。农历分为阴历和阳历就是这样的表示。但自从采用西方的“公元历法”,现在的阳历就基本上专门来表示也是“太阳历”的“公元历”。这主要跟我们的习惯有关。因为作为中国日期记录及节日的大部分,都是按照农历中的阴历来定义的。比如“除夕”就是腊月三十,年就是正月初一。端午节等等都如此。而用农历中的阳历来表示的好象只有一个算不上节日的“清明节”。农历中的阳历就是24节气,主要是为农业生产服务,说起来,农历中的阳历倒更能代表“农历”这个称谓。您应该经常听到公历、农历、阳历、阴历等历法的叫法,但公历和阳历是一回事吗?阴历和农历又有什么联系和区别?还是先来看看历法的分类吧。古今中外历法的名目甚多,但大体上可以归纳为三种:阴历、阳历和阴阳历。阴历(又称为太阴历,因古代把月亮称为太阴):这是人类历史上最早出现的历法。它的特点就是月的平均日数要以朔望月为基础,也就是符合月相的变化。一年为12个月,大月为30日,小月为29日。其中有6个大月和6个小月,全年共354天。可是,一年12个朔望月共长为29.5.3671个平太阳日。这样,一年就比12个朔望月短0.3671日,3年就短约1天。为了使历年长度接近12个朔望月的长度,每3年就设置一个闰年,凡闰年就在12月末加1天,使12月从原来的小月变为大月,即从29日变为30日。阴历每年比回归年约短11日。因此,它的最大缺点是与四季寒暑无关。显而易见,这种历法对生活和生产,特别是对农业生产极不方便。因此,现在世界上除了伊斯兰教国家由于宗教关系仍在使用阴历外,其他国家早已不再使用阴历了。阳历(又称为太阳历):阳历以地球绕太阳运动的周期为年的基础,以一个回归年长度为依据。它的月数和月所包含的日数都是人为规定的,没有任何天象依据。现在世界上大多数国家通用的公历就属于阳历。我国于1912年开始采用公历,但是,当时不用公元作为纪年。新中国成立后,于1949年改用公元作为纪元,普遍采用了公历。阴阳历:我国传统历法农历(又称夏历)就是一种阴阳历。顾名思义,阴阳历同时考虑太阳和月亮的运动,把回归年和朔望月并列为的基本周期。它的月像阴历那样以朔望月为基础,完全符合月相。它的年平均长度像阳历一样以回归年为标准,完全符合四季的交替。一年有12个月,大月为30日,小月为29日。至于哪一个月是大月,哪一个月为小月,则要根据朔和朔的日期间隔而定。两朔日期相隔为30日时定为大月,两朔日期相隔为29日时定为小月。全年平均为354日或355日,比回归年长度短了约11日,3年约差33日。为了使历法平均长度接近回归年,每3年就要设置一个闰年,闰年加1个月,该年为13个月,全年共384日或385日。然而,就是这样,阴阳历仍比回归年短。怎么办呢?我国古代的天文学家们早在公元前600年的春秋时代,就发现在19个阴历年中加入7个闰月,可以使阴阳历的历年平均长度更接近回归年。也就是说,在19年中应有12个平年(每年有12个朔望月)和7个闰年(每年有13个朔望月)。  12×12+13×7=235个朔望月  235个朔望月=29.539.6887个平太阳日  19个回归年=365.9.6018个平太阳日两者在19年中只差0.0869日,约合2小时5分8秒。当然,具体的置闰要根据实际天象计算结果来安排,哪一个月为闰月要根据24节气来定。看到这儿,您应该不会再把阳历和公历、农历和阴历弄混了吧?
04-1704-1004-0309-2202-0101-2501-2401-2401-2301-17
阅读本文后您有什么感想? 已有23人给出评价!
名称大小下载android农历转公历(公农历相互装换)时间选者器
最近公司在做一个时间选者器,涉及到日历装换,单个选择器到是没什么,但是又有农历装换就比较头疼了,下面分享一个日历转换器的代码,公历转农历的网上很多了,但是农历转公历德就比较少了,
直接上代码:
package com.openbook.mars.
* 该类主要做农历和公历的互转 支持年
* System.out.println(日历测试);
System.out.println(ChineseCalendarTwo.sCalendarLundarToSolar()); 农转工
System.out.println(ChineseCalendarTwo.sCalendarSolarToLundar()); 工转农
public class ChineseCalendarTwo {
// Array lIntLunarDay is stored in the monthly day information in every year from 1901 to 2100 of the lunar calendar,
// The lunar calendar can only be 29 or 30 days every month, express with 12(or 13) pieces of binary bit in one year,
// it is 30 days for 1 form in the corresponding location , otherwise it is 29 days
public static final int[] iLunarMonthDaysTable = { 0x4ae0, 0xa570, 0x0, 0xd950, 0x6aa8, 0x56a0, 0x9ad0, 0x4ae8,
0x4ae0, // 1910
0xa4d8, 0xa4d0, 0xd250, 0xd548, 0xb550, 0x56a0, 0x96d0, 0x95b0, 0x49b8, 0x49b0, // 1920
0xa4b0, 0xb258, 0x6a50, 0x6d40, 0xada8, 0x2b60, 0x8, 0xb0, // 1930
0xd4a0, 0xea50, 0x6d48, 0x5ad0, 0x2b60, 0xe0, 0xc968, 0xc950, 0xd4a0, // 1940
0xda50, 0xb550, 0x56a0, 0xaad8, 0x25d0, 0x92d0, 0xc958, 0xa950, 0xb4a8, 0x6ca0, // 1950
0xb550, 0x55a8, 0x4da0, 0xa5b0, 0x52b8, 0x52b0, 0xa950, 0xe950, 0x6aa0, 0xad50, // 1960
0xab50, 0x4b60, 0xa570, 0xa570, 0x0, 0xd950, 0x5aa8, 0x56a0, 0x96d0, // 1970
0x4ae8, 0x4ad0, 0xa4d0, 0xd268, 0xd250, 0xd528, 0xb540, 0xb6a0, 0x96d0, 0x95b0, // 1980
0x49b0, 0xa4b8, 0xa4b0, 0xb258, 0x6a50, 0x6d40, 0xada0, 0xab60, 0x8, // 1990
0xb0, 0x6a50, 0xea50, 0x6b28, 0x5ac0, 0xab60, 0xe0, 0xc960, // 2000
0xd4a8, 0xd4a0, 0xda50, 0x5aa8, 0x56a0, 0xaad8, 0x25d0, 0x92d0, 0xc958, 0xa950, // 2010
0xb4a0, 0xb550, 0xb550, 0x55a8, 0x4ba0, 0xa5b0, 0x52b8, 0x52b0, 0xa930, 0x74a8, // 2020
0x6aa0, 0xad50, 0x4da8, 0x4b60, 0xe0, 0xd260, 0xe930, 0xd530, 0x5aa0, // 2030
0x6b50, 0x96d0, 0x4ae8, 0x4ad0, 0xa4d0, 0xd258, 0xd250, 0xd520, 0xdaa0, 0xb5a0, // 2040
0x56d0, 0x4ad8, 0x49b0, 0xa4b8, 0xa4b0, 0xaa50, 0xb528, 0x6d20, 0xada0, 0x55b0 // 2050
// Array iLunarLeapMonthTable preserves the lunar calendar leap month from 1901 to 2050,
// if it is 0 express not to have , every byte was stored for two years
public static final char[] iLunarLeapMonthTable = { 0x00, 0x50, 0x04, 0x00, 0x20, // 1910
0x60, 0x05, 0x00, 0x20, 0x70, // 1920
0x05, 0x00, 0x40, 0x02, 0x06, // 1930
0x00, 0x50, 0x03, 0x07, 0x00, // 1940
0x60, 0x04, 0x00, 0x20, 0x70, // 1950
0x05, 0x00, 0x30, 0x80, 0x06, // 1960
0x00, 0x40, 0x03, 0x07, 0x00, // 1970
0x50, 0x04, 0x08, 0x00, 0x60, // 1980
0x04, 0x0a, 0x00, 0x60, 0x05, // 1990
0x00, 0x30, 0x80, 0x05, 0x00, // 2000
0x40, 0x02, 0x07, 0x00, 0x50, // 2010
0x04, 0x09, 0x00, 0x60, 0x04, // 2020
0x00, 0x20, 0x60, 0x05, 0x00, // 2030
0x30, 0xb0, 0x06, 0x00, 0x50, // 2040
0x02, 0x07, 0x00, 0x50, 0x03 // 2050
// Array iSolarLunarTable stored the offset days
// in New Year of solar calendar and lunar calendar from 1901 to 2050;
private static final char[] iSolarLunarOffsetTable = { 49, 38, 28, 46, 34, 24, 43, 32, 21, 40, // 1910
29, 48, 36, 25, 44, 34, 22, 41, 31, 50, // 1920
38, 27, 46, 35, 23, 43, 32, 22, 40, 29, // 1930
47, 36, 25, 44, 34, 23, 41, 30, 49, 38, // 1940
26, 45, 35, 24, 43, 32, 21, 40, 28, 47, // 1950
36, 26, 44, 33, 23, 42, 30, 48, 38, 27, // 1960
45, 35, 24, 43, 32, 20, 39, 29, 47, 36, // 1970
26, 45, 33, 22, 41, 30, 48, 37, 27, 46, // 1980
35, 24, 43, 32, 50, 39, 28, 47, 36, 26, // 1990
45, 34, 22, 40, 30, 49, 37, 27, 46, 35, // 2000
23, 42, 31, 21, 39, 28, 48, 37, 25, 44, // 2010
33, 23, 41, 31, 50, 39, 28, 47, 35, 24, // 2020
42, 30, 21, 40, 28, 47, 36, 25, 43, 33, // 2030
22, 41, 30, 49, 37, 26, 44, 33, 23, 42, // 2040
31, 21, 40, 29, 47, 36, 25, 44, 32, 22, // 2050
static boolean bIsSolarLeapYear(int iYear) {
return ((iYear % 4 == 0) && (iYear % 100 != 0) || iYear % 400 == 0);
// 在阳历的日子
static int iGetSYearMonthDays(int iYear, int iMonth) {
if ((iMonth == 1) || (iMonth == 3) || (iMonth == 5) || (iMonth == 7) || (iMonth == 8) || (iMonth == 10) || (iMonth == 12))
return 31;
else if ((iMonth == 4) || (iMonth == 6) || (iMonth == 9) || (iMonth == 11))
return 30;
else if (iMonth == 2) {
if (bIsSolarLeapYear(iYear))
return 29;
return 28;
//抵消天新年,指出在阳历的日子
static int iGetSNewYearOffsetDays(int iYear, int iMonth, int iDay) {
int iOffsetDays = 0;
for (int i = 1; i & iM i++) {
iOffsetDays += iGetSYearMonthDays(iYear, i);
iOffsetDays += iDay - 1;
return iOffsetD
static int iGetLLeapMonth(int iYear) {
char iMonth = iLunarLeapMonthTable[(iYear - 1901) / 2];
if (iYear % 2 == 0)
return (iMonth & 0x0f);
return (iMonth & 0xf0) && 4;
static int iGetLMonthDays(int iYear, int iMonth) {
int iLeapMonth = iGetLLeapMonth(iYear);
if ((iMonth & 12) && (iMonth - 12 != iLeapMonth) || (iMonth & 0)) {
System.out.println(Wrong month, ^_^ , i think you are want a -1, go to death!);
return -1;
if (iMonth - 12 == iLeapMonth) {
if ((iLunarMonthDaysTable[iYear - 1901] & (0x8000 && iLeapMonth)) == 0)
return 29;
return 30;
if ((iLeapMonth & 0) && (iMonth & iLeapMonth))
if ((iLunarMonthDaysTable[iYear - 1901] & (0x8000 && (iMonth - 1))) == 0)
return 29;
return 30;
// 天在今年的阴历
static int iGetLYearDays(int iYear) {
int iYearDays = 0;
int iLeapMonth = iGetLLeapMonth(iYear);
for (int i = 1; i & 13; i++)
iYearDays += iGetLMonthDays(iYear, i);
if (iLeapMonth & 0)
iYearDays += iGetLMonthDays(iYear, iLeapMonth + 12);
return iYearD
static int iGetLNewYearOffsetDays(int iYear, int iMonth, int iDay) {
int iOffsetDays = 0;
int iLeapMonth = iGetLLeapMonth(iYear);
if ((iLeapMonth & 0) && (iLeapMonth == iMonth - 12)) {
iMonth = iLeapM
iOffsetDays += iGetLMonthDays(iYear, iMonth);
for (int i = 1; i & iM i++) {
iOffsetDays += iGetLMonthDays(iYear, i);
if (i == iLeapMonth)
iOffsetDays += iGetLMonthDays(iYear, iLeapMonth + 12);
iOffsetDays += iDay - 1;
return iOffsetD
/** 阳历变成了阴历
* @param iYear
* @param iMonth
* @param iDay
public static String sCalendarSolarToLundar(int iYear, int iMonth, int iDay) {
int iLDay, iLMonth, iLY
int iOffsetDays = iGetSNewYearOffsetDays(iYear, iMonth, iDay-1);
int iLeapMonth = iGetLLeapMonth(iYear);
if (iOffsetDays & iSolarLunarOffsetTable[iYear - 1901]) {
iLYear = iYear - 1;
iOffsetDays = iSolarLunarOffsetTable[iYear - 1901] - iOffsetD
iLDay = iOffsetD
for (iLMonth = 12; iOffsetDays & iGetLMonthDays(iLYear, iLMonth); iLMonth--) {
iLDay = iOffsetD
iOffsetDays -= iGetLMonthDays(iLYear, iLMonth);
if (0 == iLDay)
iLDay = 1;
iLDay = iGetLMonthDays(iLYear, iLMonth) - iOffsetDays + 1;
iLYear = iY
iOffsetDays -= iSolarLunarOffsetTable[iYear - 1901];
iLDay = iOffsetDays + 1;
for (iLMonth = 1; iOffsetDays &= 0; iLMonth++) {
iLDay = iOffsetDays + 1;
iOffsetDays -= iGetLMonthDays(iLYear, iLMonth);
if ((iLeapMonth == iLMonth) && (iOffsetDays & 0)) {
iLDay = iOffsetD
iOffsetDays -= iGetLMonthDays(iLYear, iLMonth + 12);
if (iOffsetDays &= 0) {
iLMonth += 12 + 1;
iLMonth--;
return + iLYear + (iLMonth & 9 ? + iLMonth : 0 + iLMonth) + (iLDay & 9 ? + iLDay : 0 + iLDay);
/**农历是变成阳历
* @param iYear
* @param iMonth
* @param iDay
public static String sCalendarLundarToSolar(int iYear, int iMonth, int iDay) {
int iSYear, iSMonth, iSD
int iOffsetDays = iGetLNewYearOffsetDays(iYear, iMonth, iDay+1) + iSolarLunarOffsetTable[iYear - 1901];
int iYearDays = bIsSolarLeapYear(iYear) ? 366 : 365;
if (iOffsetDays &= iYearDays) {
iSYear = iYear + 1;
iOffsetDays -= iYearD
iSYear = iY
iSDay = iOffsetDays + 1;
for (iSMonth = 1; iOffsetDays &= 0; iSMonth++) {
iSDay = iOffsetDays + 1;
iOffsetDays -= iGetSYearMonthDays(iSYear, iSMonth);
iSMonth--;
return + iSYear + (iSMonth & 9 ? iSMonth + : 0 + iSMonth) + (iSDay & 9 ? iSDay + : 0 + iSDay);
// 自定义星期类
class Week {
private String sWeek[] = { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday };
public Week() {
iWeek = 0;
public Week(int w) {
if ((w & 6) || (w & 0)) {
System.out.println(Week out of range, I think you want Sunday);
this.iWeek = 0;
this.iWeek =
public String toString() {
return sWeek[iWeek];
// 自定义日期类
class MyDate {
public int iY
public int iM
public int iD
private static int checkYear(int iYear) {
if ((iYear & 1901) && (iYear & 2050))
System.out.println(The Year out of range, I think you want 1981);
return 1981;
public MyDate(int iYear, int iMonth, int iDay) {
this.iYear = checkYear(iYear);
this.iMonth = iM
this.iDay = iD
public MyDate(int iYear, int iMonth) {
this.iYear = checkYear(iYear);
this.iMonth = iM
this.iDay = 1;
public MyDate(int iYear) {
this.iYear = checkYear(iYear);
this.iMonth = 1;
this.iDay = 1;
public MyDate() {
this.iYear = 1981;
this.iMonth = 1;
this.iDay = 1;
public String toString() {
return + this.iYear + (this.iMonth & 9 ? + this.iMonth : 0 + this.iMonth)
+ (this.iDay & 9 ? + this.iDay : 0 + this.iDay);
public boolean equals(MyDate md) {
return ((md.iDay == this.iDay) && (md.iMonth == this.iMonth) && (md.iYear == this.iYear));
// 阳历日期类,继承自定义日期
class SolarDate extends MyDate {
private static int checkMonth(int iMonth) {
if (iMonth & 12) {
System.out.println(Month out of range, I think you want 12 );
return 12;
} else if (iMonth & 1) {
System.out.println(Month out of range, I think you want 1 );
private static int checkDay(int iYear, int iMonth, int iDay) {
int iMonthDays = ChineseCalendarTwo.iGetSYearMonthDays(iYear, iMonth);
if (iDay & iMonthDays) {
System.out.println(Day out of range, I think you want + iMonthDays + );
return iMonthD
} else if (iDay & 1) {
System.out.println(Day out of range, I think you want 1 );
public SolarDate(int iYear, int iMonth, int iDay) {
super(iYear);
this.iMonth = checkMonth(iMonth);
this.iDay = checkDay(this.iYear, this.iMonth, iDay);
public SolarDate(int iYear, int iMonth) {
super(iYear);
this.iMonth = checkMonth(iMonth);
public SolarDate(int iYear) {
super(iYear);
public SolarDate() {
public String toString() {
return + this.iYear + (this.iMonth & 9 ? - + this.iMonth : -0 + this.iMonth)
+ (this.iDay & 9 ? - + this.iDay : -0 + this.iDay);
public Week toWeek() {
int iOffsetDays = 0;
for (int i = 1901; i & iY i++) {
if (ChineseCalendarTwo.bIsSolarLeapYear(i))
iOffsetDays += 366;
iOffsetDays += 365;
iOffsetDays += ChineseCalendarTwo.iGetSNewYearOffsetDays(iYear, iMonth, iDay);
return new Week((iOffsetDays + 2) % 7);
public LunarDate toLunarDate() {
int iYear, iMonth, iDay, iD
iDate = Integer.parseInt(ChineseCalendarTwo.sCalendarSolarToLundar(this.iYear, this.iMonth, this.iDay));
iYear = iDate / 10000;
iMonth = iDate % 10000 / 100;
iDay = iDate % 100;
ld = new LunarDate(iYear, iMonth, iDay);
// 阴历日期类,继承自定义日期类
class LunarDate extends MyDate {
private String sChineseNum[] = { 零, 一, 二, 三, 四, 五, 六, 七, 八, 九, 十 };
private static int checkMonth(int iYear, int iMonth) {
if ((iMonth & 12) && (iMonth == ChineseCalendarTwo.iGetLLeapMonth(iYear) + 12)) {
} else if (iMonth & 12) {
System.out.println(Month out of range, I think you want 12 );
return 12;
} else if (iMonth & 1) {
System.out.println(Month out of range, I think you want 1 );
private static int checkDay(int iYear, int iMonth, int iDay) {
int iMonthDays = ChineseCalendarTwo.iGetLMonthDays(iYear, iMonth);
if (iDay & iMonthDays) {
System.out.println(Day out of range, I think you want + iMonthDays + );
return iMonthD
} else if (iDay & 1) {
System.out.println(Day out of range, I think you want 1 );
public LunarDate(int iYear, int iMonth, int iDay) {
super(iYear);
this.iMonth = checkMonth(this.iYear, iMonth);
this.iDay = checkDay(this.iYear, this.iMonth, iDay);
public LunarDate(int iYear, int iMonth) {
super(iYear);
this.iMonth = checkMonth(this.iYear, iMonth);
public LunarDate(int iYear) {
super(iYear);
public LunarDate() {
public String toString() {
String sCalendar = 农历;
sCalendar += sChineseNum[iYear / 1000] + sChineseNum[iYear % 1000 / 100] + sChineseNum[iYear % 100 / 10]
+ sChineseNum[iYear % 10] + ( + toChineseEra() + )年;
if (iMonth & 12) {
iMonth -= 12;
sCalendar += 闰;
if (iMonth == 12)
sCalendar += 腊月;
else if (iMonth == 11)
sCalendar += 冬月;
else if (iMonth == 1)
sCalendar += 正月;
sCalendar += sChineseNum[iMonth] + 月;
if (iDay & 29)
sCalendar += 三十;
else if (iDay & 20)
sCalendar += 二十 + sChineseNum[iDay % 20];
else if (iDay == 20)
sCalendar += 二十;
else if (iDay & 10)
sCalendar += 十 + sChineseNum[iDay % 10];
sCalendar += 初 + sChineseNum[iDay];
public CnWeek toWeek() {
int iOffsetDays = 0;
for (int i = 1901; i & iY i++)
iOffsetDays += ChineseCalendarTwo.iGetLYearDays(i);
iOffsetDays += ChineseCalendarTwo.iGetLNewYearOffsetDays(iYear, iMonth, iDay);
return new CnWeek((iOffsetDays + 2) % 7);
public ChineseEra toChineseEra() {
return new ChineseEra(iYear);
public SolarDate toSolarDate() {
int iYear, iMonth, iDay, iD
iDate = Integer.parseInt(ChineseCalendarTwo.sCalendarLundarToSolar(this.iYear, this.iMonth, this.iDay));
iYear = iDate / 10000;
iMonth = iDate % 10000 / 100;
iDay = iDate % 100;
sd = new SolarDate(iYear, iMonth, iDay);
class CnWeek extends Week {
private String sCnWeek[] = { 日, 一, 二, 三, 四, 五, 六 };
public CnWeek() {
public CnWeek(int iWeek) {
super(iWeek);
public String toString() {
return 星期 + sCnWeek[this.iWeek];
class ChineseEra {
String[] sHeavenlyStems = { 甲, 乙, 丙, 丁, 戊, 己, 庚, 辛, 壬, 癸 };
String[] sEarthlyBranches = { 子, 丑, 寅, 卯, 辰, 巳, 午, 未, 申, 酉, 戌, 亥 };
public ChineseEra() {
int iYear = 1981;
public ChineseEra(int iYear) {
if ((iYear & 2050) && (iYear & 1901))
this.iYear = iY
this.iYear = 1981;
public String toString() {
temp = Math.abs(iYear - 1924);
return sHeavenlyStems[temp % 10] + sEarthlyBranches[temp % 12];
把整个时间选择器做完了,在全部分享出来

我要回帖

更多关于 阳历是农历吗 的文章

 

随机推荐