# AuraLocalizationService

`AuraLocalizationService` provides methods for formatting and localizing dates. Use `$A.localizationService` to use the methods in `AuraLocalizationService`.

## Methods

- **[UTCToWallTime()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-utctowalltime.md)**

  Converts a datetime from UTC to a specified timezone.

- **[WallTimeToUTC](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-walltimetoutc.md)**

  Converts a datetime from a specified timezone to UTC.

- **[displayDuration()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-displayduration.md)**

  Displays a length of time.

- **[displayDurationInDays()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-displaydurationindays.md)**

  Displays a length of time in days.

- **[displayDurationInHours()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-displaydurationinhours.md)**

  Displays a length of time in hours.

- **[displayDurationInMilliseconds()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-displaydurationinmilliseconds.md)**

  Displays a length of time in milliseconds.

- **[displayDurationInMinutes()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-displaydurationinminutes.md)**

  Displays a length of time in minutes.

- **[displayDurationInMonths()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-displaydurationinmonths.md)**

  Displays a length of time in months.

- **[displayDurationInSeconds()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-displaydurationinseconds.md)**

  Displays a length of time in seconds.

- **[duration()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-duration.md)**

  Returns an object representing a length of time.

- **[endOf()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-endof.md)**

  Returns a date that is the end of a unit of time for the given date.

- **[formatCurrency()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-formatcurrency.md)**

  Returns a currency number based on the default currency format.

- **[formatDate()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-formatdate.md)**

  Returns a formatted date.

- **[formatDateTime()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-formatdatetime.md)**

  Returns a formatted date time.

- **[formatDateTimeUTC()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-formatdatetimeutc.md)**

  Returns a formatted date time in UTC.

- **[formatDateUTC()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-formatdateutc.md)**

  Returns a formatted date in UTC.

- **[formatNumber()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-formatnumber.md)**

  Returns a formatted number with the default number format.

- **[formatPercent()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-formatpercent.md)**

  Returns a formatted percentage number based on the default percentage format.

- **[formatTime()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-formattime.md)**

  Returns a formatted time.

- **[formatTimeUTC()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-formattimeutc.md)**

  Returns a formatted time in UTC.

- **[getDateStringBasedOnTimezone](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-getdatestringbasedontimezone.md)**

  Gets a date string based on a time zone.

- **[getDaysInDuration()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-getdaysinduration.md)**

  Returns the number of days in a duration.

- **[getDefaultCurrencyFormat()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-getdefaultcurrencyformat.md)**

  Returns the default currency format.

- **[getDefaultNumberFormat()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-getdefaultnumberformat.md)**

  Returns the default `NumberFormat` object.

- **[getDefaultPercentFormat()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-getdefaultpercentformat.md)**

  Returns the default percentage format.

- **[getHoursInDuration()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-gethoursinduration.md)**

  Returns a length of time in hours.

- **[getLocalizedDateTimeLabels()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-getlocalizeddatetimelabels.md)**

  Deprecated. Do not use. Returns date time labels, such as month name, weekday name.

- **[getMillisecondsInDuration()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-getmillisecondsinduration.md)**

  Returns the number of milliseconds in a duration.

- **[getMinutesInDuration()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-getminutesinduration.md)**

  Returns the number of minutes in a duration.

- **[getMonthsInDuration()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-getmonthsinduration.md)**

  Returns the number of months in a duration.

- **[getNumberFormat()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-getnumberformat.md)**

  Returns a `NumberFormat` object.

- **[getSecondsInDuration()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-getsecondsinduration.md)**

  Returns the number of seconds in a duration.

- **[getToday](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-gettoday.md)**

  Gets today’s date based on a time zone.

- **[getYearsInDuration()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-getyearsinduration.md)**

  Returns the number of years in a duration.

- **[isAfter()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-isafter.md)**

  Checks if `date1` is after `date2`.

- **[isBefore()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-isbefore.md)**

  Checks if `date1` is before `date2`.

- **[isBetween()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-isbetween.md)**

  Checks if `date` is between `fromDate` and `toDate`, where the match is inclusive.

- **[isPeriodTimeView()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-isperiodtimeview.md)**

  Deprecated. Do not use. Checks if a datetime pattern string uses a 24-hour or 12-hour time view.

- **[isSame()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-issame.md)**

  Checks if `date1` is the same as `date2`.

- **[parseDateTime()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-parsedatetime.md)**

  Parses a string and returns a JavaScript Date.

- **[parseDateTimeISO8601()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-parsedatetimeiso8601.md)**

  Parses a date time string in an ISO-8601 format and returns a JavaScript Date.

- **[parseDateTimeUTC()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-parsedatetimeutc.md)**

  Parses a string and returns a JavaScript Date.

- **[startOf()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-startof.md)**

  Returns a date that is the start of a unit of time for the given date.

- **[toISOString()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-toisostring.md)**

  Deprecated. Use `Date.toISOString()` instead.

- **[translateFromLocalizedDigits()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-translatefromlocalizeddigits.md)**

  Translate the localized digit string to a string with Arabic digits, if there is any.

- **[translateFromOtherCalendar()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-translatefromothercalendar.md)**

  Translates the input date from another calendar system (for example, the Buddhist calendar) to the Gregorian calendar based on the locale.

- **[translateToLocalizedDigits()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-translatetolocalizeddigits.md)**

  Translate the input string to a string with localized digits, if there is any.

- **[translateToOtherCalendar()](/docs/platform/aura-platform/guide/ref-jsapi-auralocalizationservice-translatetoothercalendar.md)**

  Translates the input date to a date in another calendar system (for example, the Buddhist calendar) based on the locale.

**See Also**

- [Formatting Dates in JavaScript](/docs/platform/aura-platform/guide/js-cb-format-dates.md)
