PHP achieves mutual conversion between the Gregorian calendar date and the lunar calendar date.
PHP achieves mutual conversion between Gregorian and lunar dates
Preface:
Today, according to the customer's needs, the time was converted, that is, the customer requested to increase the display of the lunar date, copied a section on the Internet, and slightly modifie
There are already a lot of C # lunar classes on the Internet, but it seems complicated. In fact, C # already provides ChineseLunisolarCalendar for Chinese lunar classes. However, it does not provide solar term and holiday functions.
According to the method byte on the Internet, a Chinese lunar calendar class is written!
ChinaDate. GetChinaDate (DateTime dt) to ob
This article mainly introduces PHP to implement the conversion from the Gregorian calendar to the lunar calendar. The example analyzes the principle and implementation skills of the conversion from the Gregorian calendar to the lunar calendar, which has some reference value. If you need it, you can refer
This article mainly introduces PHP to implement the conversion from the Gregorian calendar to the
The following JS class is re-designed using the object-oriented idea, making queries today faster than the day of the lunar calendar.
Function chinesecalendar (dateobj ){This. dateobj = (dateobj! = Undefined )? Dateobj: new date ();This. Sy = This. dateobj. getfullyear ();This. Sm = This. dateobj. getmonth ();This. SD = This. dateobj. getdate ();This. lunarinfo = [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x0
Perhaps a lot of people because of traditional habits, will have a lunar birthday, so bring a curious question, birthday to which year the lunar calendar will coincide? Do you have to check it? Well, you are ruthless, although there are 19 years of the lunar calendar will coincide one said, in fact, the number of years interval is indeed nearly 19 times times the
Php code for implementing the lunar calendar
The code is as follows:
Php lunar calendar
######################################## #### Author: Shen Yan (S S Lab )## E-mail: shenlian@hotmail.com ## Web: http://www.focus-2000.com #### Copyright Statement :## Copyright granted by the Author ## Allow unconditional use of all or part of this file ## Any modifications or additions can be made ## If you use thi
This article mainly introduces the method of implementing the Gregorian lunar calendar in PHP, and also can obtain the Ganzhi, Zodiac, and the corresponding lunar calendar Chinese names, etc., interested in small partners can refer to. We hope to help you.
Recently to the Gregorian calendar to get the corresponding holiday algorithm this is more interested in this aspect, so on the internet searched a circ
Chinese Lunar | Algorithm ' The following is a lunar algorithm about VB
' Date data definition method is as follows
' The first 12 bytes represent January-December for Semi-rotary or Luna, 1 for semi-rotary 30 days, 0 for the Moon 29 days,
' 13th is the case of the leap month, 1 for semi-rotary 30 days, 0 for the Moon 29 days, and the 14th for leap months
' Part, if not the leap month is 0, otherwise g
I have nothing to worry about. I want to use shell in Linux to write a script for converting the Gregorian calendar to the lunar calendar. It will take about a week to complete. Now let's share it with you.
The principle of this script is the look-up table method (because there is an error in the formula). Based on the lunar new year as the benchmark, two different Chinese calendars before and after the
PHP solar calendar to lunar calendar implementation code
PHP solar calendar to lunar calendar conversion class code
// A class for converting the solar calendar to the lunar calendar in PHP
Class Calendar
{
# Number of days of the lunar calendar month
Var $ everyCMonth =
You only need to install the lunar-applet in Ubuntu10.04 to display the lunar calendar and festivals. Installation code: sudoapt-getinstalllunar-applet deletes the program that displays the date on the Gnome panel, right-click the panel at the top of the screen, and click "add to panel": Lunar date, right-click "Preferences" and select "select from
Brief introduction
If an enterprise relies on a service-oriented architecture, it must ensure that the service is running normally and reliably. The most important driver behind application reliability is where to host the service and how to host the service. When considering managed services, you must consider several issues in advance: what are the availability requirements for the service? How do I manage and deploy services? Do you need to provide support for older versions of the service?
Recently, the author in the era of Interconnection (www.now.cn) learned that it in Guangzhou, Dongguan, Shenzhen, the telecommunications room quietly to do the promotional activities, 1U a year of server hosting costs can be reduced by 1000 to 2000 yuan, in different areas of the room have different preferential policies, This in the context of the financial crisis will undoubtedly be in the pursuit of small and medium-sized enterprises and stationmas
Objective
The previous sections briefly introduce the routes and pipelines in the Web API and do not describe anything in detail, however, the framework of the ASP.net Web API is very different from the host environment and the way in which the implementation mechanism and route are handled in different hosting environments. So I will make a simple explanation for the different hosting environment.
asp.n
Asp. NET how to display Chinese lunar timeThe CS section code is as follows:The code is as follows: public string chinesetimenow = "";public string forigntimenow = "";private static Chineselunisolarcalendar calendar = new Chineselunisolarcalendar ();private static string Chinesenumber = "0 123456789";Public Const string Celestialstem = "Methyl-n-Xing";Public Const string Terrestrialbranch = "Obscure Chen has not Shin Hai";public static readonly string
From #Coding=utf-8 #******************************************************************************#The following is the lunar calendar to calculate the required data, in order to save storage space, so use the following more abnormal storage methods.#******************************************************************************#the array g_lunar_month_day is deposited into the lunar calendar from 1901 to 20
You have prepared to write it yourself.AlgorithmAnd study the lunar calendar rules. I found that it was too difficult and troublesome. Just for the calculation of the lunar calendar, I will wait for the people who specialize in calendar to understand it. Later I found out. Net Class Library also provides some basic lunar class system. Globalization. chineseluniso
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.