SShortSingh.
Back to feed

Why Simple Math Formulas Fail at Gregorian-to-Hijri Date Conversion

0
·1 views

A common one-line formula circulating on developer forums attempts to convert Gregorian years to Hijri by applying a fixed ratio, but this approach produces frequent errors. The core problem is that the Hijri calendar is lunar, running roughly 10–11 days shorter than a solar Gregorian year, and the drift between the two systems accumulates unevenly rather than at a constant rate. Complicating matters further, multiple standardized Hijri systems exist — including the arithmetically predictable tabular calendar and Saudi Arabia's official Umm al-Qura calendar, which is based on astronomical lunar observations and can differ from tabular systems by a full day. This discrepancy has real-world consequences for applications handling government documents, religious dates, or age calculations for Saudi users. Developers are advised to use Julian Day Number as an intermediate conversion step and to explicitly support the specific Hijri variant required, rather than relying on ratio-based shortcuts.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Why Top AI Agent Platforms Are Ditching Vector Databases for Markdown Files

A growing number of high-traffic AI agent platforms, including Claude Code and Manus, are replacing complex vector databases with plain markdown files as their primary memory storage layer. The approach relies on a core system design principle: separating storage from search, where markdown files serve as the canonical source of truth and search indexes such as vector or BM25 are treated as disposable, rebuildable artifacts. This architecture offers three key benefits — Git-native version control for auditability, the freedom to swap retrieval algorithms without data loss, and full portability since migration requires only a file copy. Each memory unit is written as a structured file with YAML frontmatter capturing metadata like timestamps, confidence levels, and entity links, ensuring clean and precise data at the point of storage. Proponents argue that simple retrieval over well-structured memory consistently outperforms sophisticated RAG pipelines built on noisy, unstructured data.

0
ProgrammingDEV Community ·

How to Audit and Secure Your Mac Homebrew Dev Environment Against CVEs

Developer workstations accumulate outdated packages and stale Homebrew taps over time, creating security risks that often go unnoticed until something breaks. Several popular taps, including hashicorp/tap and weaveworks/tap, are now obsolete and should be removed since their tools have moved to homebrew-core or the maintaining company has shut down. Released in January 2026, brew-vulns is Homebrew's first-party vulnerability scanner that queries OSV.dev to identify CVEs in installed packages and can generate SBOMs and SARIF reports. For pre-upgrade safety checks, the brew safe-upgrade tool cross-references OSV, GitHub Advisory, and NIST NVD databases before modifying any installed packages. When a fix exists on a project's main branch but has not yet been formally released, developers can use brew install --HEAD to build directly from source and pin the version to prevent reverting to a vulnerable stable bottle.

0
ProgrammingDEV Community ·

Open AI Models Gain Ground as Government Takedown Highlights Hosting Risks

A government order that abruptly pulled a leading hosted AI model offline has prompted businesses to reconsider their reliance on closed, third-party AI providers. Several powerful open-source models — including DeepSeek-V4-Pro and MiniMax-M3 — launched around June 22, 2026, and quickly topped download charts. Independent evaluator Artificial Analysis found the best open model now outperforms at least one major OpenAI model on practical knowledge-work tasks, though it still trails top Anthropic offerings. Hosting firm Baseten demonstrated that open models can now be served at frontier-class speeds on modern hardware, removing a key advantage closed providers once held. Experts caution that running the largest open models still requires significant hardware investment, and self-reported model specifications have not been independently verified.

0
ProgrammingHacker News ·

Classic Sci-Fi Short Story 'Why I Left Harry's All-Night Hamburgers' Resurfaces Online

A 2013 Escape Pod podcast episode featuring the science fiction short story 'Why I Left Harry's All-Night Hamburgers' has resurfaced on Hacker News. The story, originally published in written form years prior, explores themes of wanderlust and alternate realities through a diner setting. The Escape Pod link, posted with minimal engagement, received 3 points and 1 comment on the platform. The submission appears to be a nostalgic or rediscovery share rather than a breaking news item.

Why Simple Math Formulas Fail at Gregorian-to-Hijri Date Conversion · ShortSingh