Toolivaro

Calculadora de diferença entre datas grátis

Calcule o número exato de dias, semanas, meses e anos entre duas datas — com um único método confiável.

A calculadora de diferença entre datas informa quanto tempo há entre duas datas, expresso de todas as formas úteis de uma vez: total de dias corridos, semanas completas mais os dias restantes, meses completos e anos completos. O método é deliberadamente simples e está descrito na página: a diferença é medida em dias corridos entre as duas datas (o dia inicial não é contado; a data final é incluída quando é um dia completo), e as unidades maiores são derivadas dessa contagem com as aproximações padrão — um mês tem em média 30,44 dias e um ano tem em média 365,25 dias. Como todas as unidades derivam de uma única contagem de dias, os resultados sempre concordam entre si — exatamente a propriedade que as pessoas precisam ao planejar: se um prazo é "2 semanas" ou "14 dias" nunca deve depender de qual ferramenta você usou. A calculadora ignora fusos horários: ela compara datas de calendário, não instantes, então mudanças de horário de verão não podem alterar o resultado. Tudo roda localmente no seu navegador — suas datas nunca saem do seu dispositivo e nunca são registradas. Use esta calculadora para períodos de contrato, janelas de reserva, durações de projeto e qualquer planejamento que precise de uma contagem de dias defensável.

Processado localmente no seu navegador

Como usar esta calculadora

What this calculator is for, and when to use the business-days tool instead

The date difference calculator tells you exactly how much time sits between two dates, in every unit you might need on one screen: total calendar days, whole weeks plus remaining days, whole months, and whole years. It is the tool to reach for when a number must be defensible: a contract period, a notice window, a rental agreement, a booking window, a project duration, or a countdown where someone will ask how you counted. Because the day count is exact and the larger units derive from that same count, all four answers agree with each other, which matters more than it sounds: a deadline described as two weeks should always equal fourteen days, no matter which page you used. The calculation runs entirely in your browser, and your dates are never uploaded, logged, or stored. Use it whenever the number will go into writing, an email, or a contract, because written numbers are the ones that get argued over.

The calculator counts calendar days: every midnight boundary between the two dates is one day, and weekends and holidays are included, because a week of a rental or a contract is seven calendar days, not five. If your question is about working days, how many business days until a payment lands or a review is due, that is the job of the business-days calculator, which skips weekends and holidays. This tool also does not measure age in the birthday sense, and it works with dates only, not times of day. What it does guarantee is a single, stated, repeatable method: the same two dates always return the same numbers, anywhere on Earth, in any time zone, which is exactly what you want when the number has to survive an argument. Two people counting the same span with the same method will never disagree, and that consistency is the point of using a calculator at all.

Choosing the two dates and getting the counting convention right

The two fields are Start date and End date, standard date pickers that also accept typed dates in YYYY-MM-DD form. The order does not matter: the calculator takes the absolute difference, so entering the later date first returns the same result, which is handy when you realize you typed them backward. The counting convention is stated on the page: the start day is not counted, and the end day is counted when it is a full day. In practice that means January 1 to January 2 is 1 day, January 1 to January 1 is 0 days, and a booking that starts March 1 and ends March 31 spans 30 days. If your contract, lease, or school counts both endpoints, treating the start date itself as day one, add one day to whatever this tool returns, and write that convention down so nobody re-counts differently later. A recorded convention beats a remembered one, especially in shared documents.

Two pitfalls trip people up. First, mixing counting conventions mid-plan: if one document uses midnight counting and another counts both endpoints, the same period will disagree by a day, so pick one convention and apply it everywhere. Second, expecting weekends and holidays to disappear: because these are calendar days, a two-week window always includes two weekends, and that is correct for rental and contract math even though it feels wrong for work planning. Time zones cannot shift the result, because the calculator compares calendar dates, not instants: a daylight-saving change in between does not add or remove a day. And this tool only measures the gap between two dates you already have; if you need the date that falls 45 days from today, that is a different calculation entirely. Reversed inputs are the third pitfall that is not one: the result is identical, so there is nothing to fix.

Reading the results: days, weeks, months, and years

The results panel gives you four lines that all tell the same story in different granularities. Total days is the exact calendar-day count, the number to quote in a contract or a dispute. Weeks and days splits that count into whole 7-day blocks and the remainder: 90 days becomes 12 weeks and 6 days, and the pair always reconciles back to the total, which is a quick sanity check. Months and years are derived from the same day count using the standard averages: 30.44 days per month and 365.25 days per year, the latter already accounting for leap years. Both are rounded down to whole units, so 45 days shows as 1 month, not 1.48, and 396 days shows as 1 year even though it contains about thirteen months. The four lines are deliberately consistent, and any two of them that disagree mean you are looking at a different calculation. That is the design working: one exact count, four ways of saying it.

Read the months and years lines as summaries, not calendar-aware facts: 2 months between January 15 and April 15 does not mean two full calendar months by their actual lengths, it means 90 days divided by 30.44 and rounded down. That is the honest trade-off behind the design: month and year lengths vary, so any month count is a convention, and deriving all of them from one exact day count keeps the results consistent and defensible. When the stakes are high, quote the days line: 90 days is unambiguous, while 3 months leaves room for interpretation. And if a result looks wrong, check the convention before the calendar: most disagreements about day counts are disagreements about whether the start or end day was counted, not about the dates themselves. The calculator cannot know which convention your document uses, so it states its own plainly and lets you translate. That translation is the whole adjustment: one day, added or subtracted, on top of a number you can trust.

Como o resultado é calculado?

Período de contrato: de 15 de janeiro a 15 de abril

Um contrato vai de 15 de janeiro a 15 de abril de um ano não bissexto. A contagem é de 90 dias corridos — ou seja, 12 semanas completas e 6 dias restantes, 2 meses completos e 0 anos completos. As quatro respostas vêm da mesma contagem de 90 dias, então são internamente consistentes.

Exemplo de entrada e saída
Entrada Valor
startDate 2026-01-15
endDate 2026-04-15
Resultado 90 dias · 12 semanas + 6 dias · 2 meses · 0 anos

100-day booking across the spring clock change: Mar 1 to Jun 9

A 100-day rental booking runs from March 1 to June 9, 2026, and the number has to be right, because the deposit, the cleaning handover, and the refund all hang on it. Count the days: March has 31 days, April 30, May 31, and June 9 is the end date, counted as a full day while the start day is not counted, so the total is 31 + 30 + 31 + 8 = 100 calendar days. The calculator splits that into 14 whole weeks and 2 remaining days, because 14 × 7 is 98. Divided by the 30.44-day average month, 100 days is 3 whole months, and it is 0 whole years. All four numbers come from that single 100-day count, so none of them can contradict another. What makes this example worth checking is the spring clock change inside the window: in most of North America and Europe the clocks move forward in March, so a naive count of 24-hour periods would be off by an hour or more. The calculator compares calendar dates, not instants, so the answer is exactly 100 days either way, like a landlord who counts rent by the calendar on the wall rather than by the clock on the mantel. If the agreement counts both the move-in and the move-out day, add one day and quote 101; if it counts midnights, 100 is the defensible number. The same two dates return the same result everywhere on Earth, which is the point of using a calculator instead of a guess.

Exemplo de entrada e saída
Entrada Valor
startDate 2026-03-01
endDate 2026-06-09
Resultado 100 days · 14 weeks + 2 days · 3 months · 0 years

Leap-day contract: Feb 29, 2028 to Mar 31, 2029

A project contract starts on February 29, 2028, a real date, because 2028 is a leap year, and it ends on March 31, 2029. Counting midnights: February 29 to March 1 is 1 day; the rest of 2028 contributes 31 for March, 30 for April, 31 for May, 30 for June, 31 for July, 31 for August, 30 for September, 31 for October, 30 for November, and 31 for December, which is 306 days, so February 29 to January 1, 2029 is 307 days. Then January contributes 31, February 2029 has 28 days because 2029 is not a leap year, and March contributes 30, which is 89 days, for a total of 307 + 89 = 396 calendar days. The calculator derives the other units from that single count: 396 divided by 7 is 56 whole weeks with 4 days left over; 396 divided by 30.44 is 13 whole months; and 396 divided by 365.25 is 1 whole year. The leap day is not a rounding artifact or a free day, it is a real day of work on a real contract, like a cashier who counts the pennies in the drawer, not just the bills. Notice that the years and months lines seem to disagree at a glance: 1 year and 13 months are both right, because the average year of 365.25 days is shorter than 13 average months of 395.72 days. Quote the 396-day figure in the contract and nobody needs to interpret anything: it is exact, it includes the leap day, and it is the same count in any time zone on Earth. Do the same count in your head and you will get the same number every time, which is the entire point of a stated method.

Exemplo de entrada e saída
Entrada Valor
startDate 2028-02-29
endDate 2029-03-31
Resultado 396 days · 56 weeks + 4 days · 13 months · 1 year

Qual é a fórmula e suas premissas?

Dias corridos

days = |dateB − dateA| in calendar days

Termos da fórmula
Símbolo Significado
dateA, dateB as duas datas, independentemente da ordem
calendar days cada virada de meia-noite conta como um dia

Dias corridos, não dias úteis — fins de semana e feriados estão incluídos. Use a calculadora de dias úteis quando eles não devessem estar.

Unidades maiores (aproximações)

weeks = ⌊days/7⌋ · months = ⌊days/30.44⌋ · years = ⌊days/365.25⌋

Termos da fórmula
Símbolo Significado
⌊x⌋ piso — a maior unidade inteira que cabe
30.44 média de dias por mês
365.25 média de dias por ano (anos bissextos incluídos)

Quais são os erros mais comuns?

  • Contar os dois extremos (matemática "inclusiva"), o que infla a contagem de dias em um — a calculadora usa as viradas de meia-noite.
  • Misturar "semanas" com "dias úteis" — esta ferramenta conta dias corridos; dias úteis são outra ferramenta.
  • Deixar diferenças de fuso horário alterarem uma contagem de prazo — datas de calendário são independentes de fuso horário.

Quais são as premissas e limitações?

  • Os valores de meses e anos são médias, não são sensíveis ao calendário (por exemplo, "2 meses" não está atrelado às durações específicas dos meses).
  • Os dias corridos incluem fins de semana e feriados por definição.
  • A calculadora trabalha apenas com datas; precisão em nível de horas está fora do escopo.

De onde vêm os números?

Última revisão 12 de agosto de 2026 · Versão 1.1.0 · Toolivaro não garante conteúdo externo.

Perguntas frequentes

A data final é incluída na contagem?

A calculadora conta as meias-noites entre as duas datas, então "1º de janeiro a 2 de janeiro" é 1 dia e "1º de janeiro a 1º de janeiro" é 0 dias. Se a sua convenção conta os dois extremos, adicione um dia ao resultado.

Por que meses e anos são aproximados?

Os meses e anos do calendário variam de duração, então qualquer contagem de meses e anos é uma convenção. Esta calculadora os deriva da contagem exata de dias com as médias padrão (30,44 e 365,25) — consistente e defensável, e sempre em concordância com a contagem de dias na mesma linha.

Fusos horários afetam o resultado?

Não — a calculadora compara datas de calendário, não instantes. Duas datas são o mesmo par de dias em qualquer lugar da Terra, então mudanças de horário de verão não podem alterar a contagem de dias.

Why does the result show weeks and days instead of just weeks?

Because weeks rarely divide a day count evenly. One hundred days is 14 weeks and 2 days, and 90 days is 12 weeks and 6 days: if the tool showed only whole weeks, the remainder would vanish and the number would no longer match the exact day count. The pair always reconciles: multiply the weeks by 7, add the remaining days, and you get the total days line. That check is the fastest way to trust a result, and it is why the weeks figure is shown as a pair rather than a single rounded number.

Does it matter which date goes in which field?

No. The calculator takes the absolute difference, so February 1 to March 1 and March 1 to February 1 both return 28 days in a non-leap year and 29 in a leap year. Typing the pair backward changes nothing, so there is no need to fix the order. Both fields expect dates in YYYY-MM-DD form, which the picker provides. If a result still looks wrong, check the convention before the calendar: the start day is not counted, the end day is counted when it is a full day, and identical dates return 0 days.

A lease says 30 days from March 1. Which date is that?

Under this calculator's convention, 30 days from March 1 is March 31: the start day is not counted, so there are 30 midnights between March 1 and March 31. If your lease counts the start day as day one instead, day 30 falls on March 30, and you would add one day to the tool's result to match that rule. The calculator states its own convention plainly because agreements differ, and the exact day count is the number you adjust from, whichever rule your document uses.

Parte de Ferramentas de tempo, datas e agendamento

Encontrou um erro ou tem uma correção? Informe — revisamos toda correção.

Foi útil?

Revisado pela equipe editorial da Toolivaro conforme nossa metodologia Metodologia · Política editorial