Skip to Content
Menu

Lunar Calendar Convert

by
Odoo
v 18.0 Third Party 13
Download for v 18.0 Deploy on Odoo.sh
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 124
Technical Name lunar_calendar
Versions 15.0 16.0 17.0 18.0
You bought this module and need support? Click here!

Lunar Calendar Convert

Introduction

The Lunar Calendar Convert module is a tool for converting solar dates to lunar dates in Odoo. This module provides utility functions to perform date conversions accurately.

Features

  • Convert solar dates to lunar dates
  • Time zone support (default is UTC+7)
  • Date validation
  • Accurate leap month calculation

Usage

To use this module, you can call the convertSolar2Lunar function from anywhere in your Odoo code:

from odoo import tools

# Convert solar date to lunar date
lunar_date = tools.convertSolar2Lunar(dd, mm, yy, timeZone=7)
    

Parameters:

  • dd: Solar day (1-31)
  • mm: Solar month (1-12)
  • yy: Solar year
  • timeZone: Time zone (default is 7 - UTC+7)

Return Value:

The function returns a string in the format: "YYYY-MM-DD"

  • YYYY: Lunar year
  • MM: Lunar month (01-12)
  • DD: Lunar day (01-30)
Note: The function will return False if the input date is invalid.

Example

# Convert February 15, 2024 to lunar date
lunar_date = tools.convertSolar2Lunar(15, 2, 2024)
# Result: "2024-01-06" (6th day of the first lunar month in Year of the Dragon)
    

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.