• What is KendoReact
  • Getting Started
  • Server Components
  • Components
    • Animation
    • Barcodes
    • Buttons
    • Chartsupdated
    • Common Utilities
    • Conversational UIupdated
    • Data Gridupdated
    • Data Query
    • Data Tools
    • Date Inputs
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Formupdated
    • Ganttupdated
    • Gauges
    • Indicators
    • Inputsupdated
    • Labels
    • Layoutupdated
    • ListBoxupdated
    • ListView
    • Map
    • Notification
    • OrgChartnew
    • PDF Processing
    • PDFViewer
    • PivotGrid
    • Popup
    • Progress Bars
    • Ripple
    • Scheduler
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • TaskBoard
    • Tooltips
    • TreeList
    • TreeViewupdated
    • Upload
  • Sample Applications
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Changelog
  • Updates
  • Troubleshooting

toLocalDate

A function that creates a local date from the UTC date parts of the input.

import { toLocalDate } from '@progress/kendo-date-math'

const date = new Date('2016-11-05');
const local = toLocalDate(date);

// For example, if the browser is in GMT+0200,
// the local date will be shifted 2 hours back:
//
// "Fri Nov 04 2016 22:00:00 GMT+0200"
console.log(local);

// This is the same as the UTC parts of the input date:
//
// "2016-11-05T22:00:00.000Z"
console.log(date.toISOString());

Parameters

date Date

The date value that will be converted. Only the UTC date parts are read.

Returns

Date Date - A local date with the UTC time parts of the supplied date.

In this article

Not finding the help you need?