Blog - Date & time
How to Calculate a Probation Period End DateCalculating the exact end date of a probation period matters for both employees and employers. Here is how the date arithmetic works, what counts as the probation end, and how to handle edge cases.
Unix Timestamps in Security and Authentication — Token Expiry, Sessions, and Rate LimitingSecurity systems depend on precise time measurement. Here is how Unix timestamps are used in authentication tokens, session management, rate limiting, and replay attack prevention.
How to Calculate Cat Age in Human Years — The Accurate MethodThe "multiply by 7" rule doesn't apply to cats. Here is how cat aging actually works, what the equivalent human years are at each life stage, and how to calculate your cat's true age.
Week Numbers for Remote Teams — How to Coordinate Across Time ZonesWhen your team is spread across multiple time zones, week numbers give everyone a shared reference point. Here is how distributed teams use ISO week numbers to coordinate work.
How to Add Business Days to a Date — The Right Way to Count Working DaysAdding business days to a date is not the same as adding calendar days. Here is how to count working days correctly, handle public holidays, and avoid common mistakes with deadlines.
Unix Timestamps in Caching and TTL — How Expiry Times Actually WorkCache expiry, TTL values, and invalidation logic all depend on Unix timestamps. Here is how caching systems use timestamps, how to debug stale cache issues, and what can go wrong.
How to Calculate Age for School Enrollment Cutoff DatesSchool enrollment cutoff dates determine whether a child starts school this year or next. Here is how to calculate whether your child meets the age requirement, what the cutoff rules are by state and country, and what redshirting means.
Week Numbers for Content and Editorial Calendars — How to Plan Publishing by WeekWeek numbers make editorial planning cleaner, especially across teams and time zones. Here is how content and media teams use ISO week numbers to schedule publications, plan campaigns, and coordinate across platforms.
How to Calculate a Product Warranty Expiry DateWarranty expiry dates are not always what they seem. Here is how to calculate when a warranty ends, what common warranty periods mean in exact dates, and how to handle warranties that start from purchase vs delivery vs registration.
Unix Timestamps in Event Sourcing and Audit LogsEvent sourcing and audit logging depend on accurate, ordered timestamps. Here is how Unix timestamps work in these systems, common pitfalls with ordering and precision, and how to avoid timestamp-related bugs in event-driven architectures.
How to Calculate Age for Insurance and Benefit EligibilityInsurance premiums and government benefits often depend on your exact age — and the rules for how age is counted vary by program and insurer. Here's how age is calculated for health insurance, Medicare, Social Security, life insurance, and pension plans.
Week Numbers for Academic and School Year PlanningSchools and universities run on term calendars that don't align neatly with ISO week numbers. Here's how to use week numbers for academic scheduling, from semester planning and assignment deadlines to staff rotas and exam timetables.
How to Calculate a Lease End Date and Renewal DeadlinesLease end dates and renewal notice deadlines are exact — a day off can cost you a security deposit or lock you into another year. Here's how to calculate them correctly, including month-end edge cases and notice period windows.
Unix Timestamps in Scheduled Tasks and Cron JobsCron jobs and scheduled tasks deal with time constantly — when to run, how long since the last run, whether a task is overdue. Here's how Unix timestamps fit into scheduling systems, and how to use them to write more reliable task logic.
How to Calculate Age for Sports and Competition Age CategoriesSports age categories use specific cutoff dates and calculation methods that can differ from your everyday age. Here's how to figure out which category you or your child falls into.
How to Calculate a Child's Age for Medical AppointmentsPediatric medicine uses age differently than everyday life — weeks for newborns, corrected age for premature babies, and exact months for vaccine schedules. Here's how to calculate a child's age correctly for medical purposes.
Week Numbers: US vs ISO — What's the Difference?US and ISO week numbering can give you different answers for the same date, especially near year boundaries. Here's exactly how they differ and when it matters.
How to Calculate a Return Window or Refund DeadlineReturn policies and refund deadlines are calendar day counts from a specific start date. Here's how to calculate exactly when your window closes — and common mistakes to avoid.
Unix Timestamp: Seconds vs Milliseconds and the Bugs They CauseThe seconds vs milliseconds mismatch between JavaScript and most backend systems is one of the most common timestamp bugs in web development. Here's what it looks like and how to fix it.
Week Numbers for Fitness and Training Plan SchedulingStructuring a training plan by week number makes it easier to track progress, schedule deload weeks, and hit race day on target. Here's how to use ISO weeks for fitness planning.
How to Calculate a Medication Course End DateKnowing exactly when a course of medication ends matters — for finishing antibiotics, scheduling follow-up appointments, and avoiding interactions. Here's how to calculate it correctly.
How to Use Unix Timestamps for Date Range QueriesDate range queries are one of the most common database operations. Using Unix timestamps makes them faster, simpler, and timezone-safe. Here's how to do it correctly.
How Many Days Old Am I? How to Calculate Your Age in Days, Weeks, and MonthsYour age in years is just one way to measure how long you have been alive. This guide explains how to calculate your exact age in days, weeks, and months — and why the number is more surprising than most people expect.
How to Convert a Unix Timestamp to a DateA Unix timestamp is just a number — converting it to a readable date takes one line in most languages. This guide shows how, and explains the common mistakes that cause bugs.
How Age Is Calculated Differently Around the WorldThe way age is counted varies more than most people realise. Western, East Asian, and legal systems all work differently — here is what changes and why it sometimes matters.
How to Calculate a Deadline from a Start DateAdding days, weeks, or months to a start date sounds simple but has several traps — especially with months of different lengths. Here is how to get it right for contracts, trials, notice periods, and project schedules.
Unix Timestamp and the Year 2038 Problem ExplainedThe Year 2038 problem is a real software bug that will affect systems storing Unix timestamps as 32-bit integers. Here is what causes it, which systems are at risk, and what is being done about it.
How to Calculate Age for Legal and Official PurposesLegal age calculations are more precise than everyday age reckoning. Here is how age is counted for driving licences, voting, retirement, benefits eligibility, and other official contexts — and where the rules differ.
Why Week 1 Doesn't Always Start on January 1In ISO week numbering, Week 1 is not simply the first seven days of January. The rule is different — and it means January 1 can fall in Week 52 or 53 of the previous year. Here is how it works and why it matters.
Unix Timestamp vs Datetime String in APIs — Which Should You Use?When designing an API, choosing between Unix timestamps and formatted datetime strings affects how clients parse dates, how you handle timezones, and what bugs you will encounter. Here is how to decide.
How to Calculate Age in Years, Months, and DaysCalculating someone's exact age in years, months, and days requires more than simple subtraction. Here is how the calculation works, what edge cases to watch out for, and how to do it manually or with a tool.
What Week Number Is It Today — How ISO Weeks WorkWhen someone asks "what week number is it?", the answer depends on which week numbering system you use. Here is how ISO week numbers work, why they do not always match what you expect, and how to find the current week number reliably.
How to Calculate a Contract End Date AccuratelyContract end dates require careful date arithmetic — a 12-month contract that starts March 15 does not end on March 14. Here is how to calculate contract end dates correctly for leases, employment agreements, service contracts, and subscriptions.
Unix Timestamp in JavaScript, Python, PHP, and Go — Code ReferenceGetting, formatting, and converting Unix timestamps works differently in each language. Here is a code reference for JavaScript, Python, PHP, and Go, with common patterns and the pitfalls that cause bugs.
How to Calculate Your Retirement Age and Years RemainingKnowing exactly how many years, months, and days remain until retirement requires more than subtracting today's year from your target. Here is how to calculate it precisely, and how retirement ages vary by country and pension type.
Week Numbers in Supply Chain and Manufacturing — How They WorkSupply chain, manufacturing, and logistics professionals use ISO week numbers for scheduling, delivery windows, and production planning. Here is how week numbers work in practice, why they matter at year boundaries, and how to convert them to calendar dates.
Unix Timestamp Timezone Pitfalls and How to Avoid ThemUnix timestamps are timezone-agnostic by design, but timezone bugs are still one of the most common mistakes when working with them. Here is where they come from and how to fix them.
Dog Age in Human Years — How to Calculate It AccuratelyThe "multiply by 7" rule for dog age in human years is a rough approximation that misses how dogs actually age. Here is the more accurate method based on life stage, breed size, and a 2020 scientific study on dog aging.
Week Numbers for Payroll and HR Scheduling — A Practical GuidePayroll periods, holiday tracking, and HR scheduling systems often run by week number. Here is how ISO week numbers work in these contexts, where the common errors occur, and how to avoid them.
How to Calculate Subscription Renewal and Expiry Dates CorrectlySubscription billing, free trials, and renewal dates depend on date arithmetic that isn't always obvious. Here is how monthly, annual, and day-count billing cycles are calculated — and where the edge cases catch people out.
Unix Timestamps in Databases — Storage, Querying, and Best PracticesStoring timestamps in databases as Unix integers vs datetime strings involves real tradeoffs. Here is how each approach works in PostgreSQL, MySQL, and SQLite, and when each makes sense.
How to Calculate Your Age in Weeks — And Why It's More Useful Than You ThinkYour age in weeks is a precise number that has real uses in infant development tracking, medical contexts, and historical calculations. Here is how to calculate it and what different week counts actually represent.
How to Use Week Numbers for Annual PlanningWeek numbers give you a precise, consistent way to plan a full year — no ambiguous month names, no shifting boundaries. Here is how to build a weekly planning rhythm using ISO week numbers.
How to Calculate a Visa or Permit Expiry DateVisa durations are expressed in days, months, or years — and the expiry date calculation matters precisely. Here is how date addition works for visas, work permits, and immigration documents.
Unix Timestamps for JWT and Token Expiry — How It WorksJWTs use Unix timestamps for expiry claims. Here is how the exp and iat fields work, how to calculate token lifetimes, and how to debug expiry issues with a timestamp converter.
How to Calculate Age from Date of Birth — Exact Years, Months, and DaysCalculating exact age from a date of birth is straightforward in principle but has real edge cases around leap years and month boundaries. Here is how it works and where to be careful.
Week Numbers in Invoicing and Billing — How to Use Them CorrectlyMany businesses reference week numbers on invoices, purchase orders, and billing cycles. Here is how ISO week numbers work in financial contexts and where mismatches cause problems.
How to Calculate Your Notice Period End DateNotice periods are stated in weeks or months, but calculating the exact last working day has edge cases. Here is how the math works and what to watch for with month-end dates and weekends.
Unix Timestamps in Log Files — How to Read and Debug ThemServer logs often contain Unix timestamps that are hard to read at a glance. Here is how to convert them, correlate log entries across systems, and spot common timestamp bugs in log analysis.
How to Calculate Age for Passport and Visa ApplicationsPassport and visa forms ask for your age or date of birth in specific formats, and errors can cause rejections. Here is how age is calculated for official travel documents and what to watch out for.
Week Numbers for Construction and Site SchedulingConstruction projects run on week-based schedules, and ISO week numbers keep everyone on the same page. Here is how to use week numbers for site planning, subcontractor coordination, and milestone tracking.
Epoch Time in APIs and Logs Explained: How to Read and Convert It CorrectlyEpoch time appears everywhere in APIs, databases, and logs, but it is easy to misread. This guide explains what epoch time means, why systems use it, and how to convert it without common mistakes.
How to Calculate Age in Months: A Practical Guide for Babies, Records, and PlanningAge in months matters more often than people think, especially for babies, forms, and milestones. This guide explains how to calculate age in months correctly and avoid common mistakes.
How to Calculate Age Accurately: Why the Answer Changes by ContextCalculating age sounds simple until legal forms, birthdays, leap years, and exact day counts enter the picture. This guide explains how to calculate age correctly and when the details matter.
How Age Works for Leap Year Birthdays: February 29 ExplainedBeing born on February 29 creates age-calculation questions people rarely think about until they matter. This guide explains leap-year birthdays, legal age questions, and how to calculate age correctly.
How to Convert a Week Number to a Date Range — The Complete GuideIf you know the week number but need the actual dates, the conversion is trickier than it looks — especially near year boundaries. Here's exactly how to do it in plain maths, Python, JavaScript, Excel, and SQL.
How to Calculate Working Weeks Between Two Dates (And Why It's Harder Than It Looks)Counting working weeks between two dates isn't as simple as dividing by 7. Notice periods, project timelines, and leave calculations all depend on getting it right — here's exactly how.
Using Week Numbers in Project Management — Sprints, Roadmaps, and the Hidden Coordination TrapsWeek numbers seem like a clean way to plan projects across teams and time zones. They are — until a US engineer and a European PM discover they're talking about different weeks. Here's how to use them without the traps.
53-Week Years — When They Happen and Why They Cause Problems in Payroll, Retail, and FinanceMost years have 52 ISO weeks. Some have 53. That extra week happens on a predictable schedule — but it still catches payroll systems, retailers, and financial teams off guard every time.
Why Excel, SQL, Python, and JavaScript Give Different Week Numbers for the Same DateAsk four tools what week number December 30 is, and you may get four different answers. Here's why — and how to make sure your tools agree.
ISO Week Numbers Explained — Why January 1 Is Sometimes in Week 52ISO week numbers follow strict rules that catch most people off guard. Week 1 isn't always in January, and December 31 can fall in week 1 of the following year. Here's exactly how it works.
How to Calculate Days Between Dates (And When It Actually Matters)Calculating the number of days between two dates sounds simple — but leap years, inclusive counts, and time zones trip people up constantly. Here's how it works and when precision matters.
What Is a Unix Timestamp (And Why Do Developers Use It)?A Unix timestamp is a single integer that represents any moment in time — no time zones, no formatting, just a number. Here's how it works and when to use it.
Adding months to a date is harder than it soundsJanuary 31 plus one month should be February 31. It isn't. Here's what actually happens and why different systems disagree.