---
title: "Discussion on \"Calculate age from a date of birth in moment javascript\" | Hashnode"
description: "Discussion on \"Calculate age from a date of birth in moment javascript\". Previously, I wrote about calculating age from a date of birth in Rails. And, now let’s do it in javascript using moment.\nimport moment from 'moment';\n\nexport const getAge = (dob: string) => {\n  const parsedDob = moment(dob);\n\n  if (!parsedDob.isVali..."
url: "https://hashnode.com/posts/calculate-age-from-a-date-of-birth-in-moment-javascript/674054411128fce4feabc301"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Calculate age from a date of birth in moment javascript](https://sinn.hashnode.dev/calculate-age-from-a-date-of-birth-in-moment-javascript?utm_source=hashnode&utm_medium=feed)

Previously, I wrote about calculating age from a date of birth in Rails. And, now let’s do it in javascript using moment. import moment from 'moment'; export const getAge = (dob: string) => { const parsedDob = moment(dob); if (!parsedDob.isVali...

Nov 22, 2024 · 1 min read · sinn.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Sinn Meas](https://hashnode.com/@Sinn)

@Sinn · Siem Reap, Cambodia

  
[View profile](https://hashnode.com/@Sinn)

A web developer in Ruby on Rails and React

My personal blog about software development and other topics.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
