Use $A.localizationService to use the methods in AuraLocalizationService. Lightning framework provides client-side localization support on input/output elements. This helps in customize the date and time format. To customize date and time format use, lightning:formattedDateTime.