SShortSingh.
Back to feed

Building a BaZi Calculator Exposed How Deeply Flawed Birth-Time Data Can Be

0
·1 views

A developer building a BaZi Chinese astrology calculator discovered that standard birth-certificate times are unreliable inputs because the tradition relies on solar time, not clock time. Three compounding factors drive the error: historical daylight saving rules, longitude offset from a zone's standard meridian, and the astronomical equation of time, which together can shift a birth time by over an hour. China's forgotten DST experiment from 1986 to 1991 is a key example, where a Shanghai birth in July 1988 was recorded an hour ahead of standard time with no modern lookup catching it. The developer found that Node.js's built-in Intl API, backed by the full IANA timezone database, can recover historical UTC offsets without bundling any extra timezone data. The post includes working TypeScript implementations and warns of subtle runtime bugs around midnight handling and performance costs of repeated DateTimeFormat instantiation.

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 ·

One Explanatory Slide Slashed Badge Complaints on Isovalent Labs Platform

Users of the Isovalent Labs platform were repeatedly reporting missing badges after completing hands-on labs, with some redoing courses multiple times hoping to trigger delivery. In reality, badges were being correctly issued via a webhook-to-Credly pipeline, but the asynchronous process meant a claim link never appeared on the lab's final screen. A simple fix — adding a single slide before the final exam explaining that a Credly email would arrive with the badge — sharply reduced complaints and unnecessary repeat completions. No backend systems were altered; the intervention worked purely by setting accurate user expectations. The episode highlights that a system's responsibility does not end at issuance: the full credential lifecycle spans notification, claim, and eventual sharing by the learner.

0
ProgrammingDEV Community ·

Step-by-Step Guide to Linking Git and GitHub via SSH Key Authentication

A developer tutorial on DEV Community outlines how to connect Git and GitHub securely using SSH key authentication. The guide walks users through installing Git, configuring a username and email, and generating an SSH key pair using the ed25519 algorithm. The public SSH key is then added to GitHub account settings to establish a trusted connection between the local machine and the remote platform. Users are then shown how to initialize a local repository, set a remote origin, and push files to GitHub using standard Git commands. The tutorial emphasizes never sharing private SSH keys and understanding each step to build a reliable version-control workflow.

0
ProgrammingDEV Community ·

Developer Builds Open-Source Android Bot That Auto-Replies to Instagram DMs Without Login

A developer has released InstaReply Bot, a free open-source Android app that automatically responds to Instagram direct messages without requiring the user's login credentials. The app works by leveraging Android's Notification Listener API to read incoming DM notifications and trigger replies through Instagram's built-in notification reply action. Users can configure keyword-based rules and choose from several free AI providers — including Groq, Gemini, and OpenRouter-compatible models — to generate contextual responses. All data, including reply rules and logs, is stored locally on the device to avoid privacy risks associated with third-party credential storage. The app also includes a three-layer deduplication system to prevent sending multiple replies to the same message during AI response generation.

0
ProgrammingDEV Community ·

Engrava 0.5.0 splits memory library and MCP server into separate packages

The Engrava project has released version 0.5.0, separating its memory library and MCP server into two distinct packages: engrava and engrava-mcp. Previously bundled together as an optional extra, the split ensures users only install the dependencies relevant to their use case. The standalone engrava-mcp package is a native stdio Model Context Protocol server and is now listed in the official MCP Registry for easier discovery by compatible clients. Alongside the packaging change, version 0.5.0 also introduces scoped ranked retrieval with metadata filters, audit verification via hash-chain journal, and typed provenance capture. Users who ran Engrava as an MCP server will need to update their install and launch commands, while those using only the Python library are unaffected.

Building a BaZi Calculator Exposed How Deeply Flawed Birth-Time Data Can Be · ShortSingh