Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

monthsToYears

import { monthsToYears } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Convert 36 months to years:
const result = monthsToYears(36)
//=> 3

// It uses floor rounding:
const result = monthsToYears(40)
//=> 3
function monthsToYears(months: number): number;
§
monthsToYears(months: number): number
[src]

§Parameters

§
months: number
[src]
  • The number of months to be converted

§Return Type

§
number
[src]

The number of months converted in years