Search

Convert String To Date Format

Articles

This function is deprecated.

Use this function to convert the given date to the day-month-year string format.

Syntax

Convert string to date format (input_date, date_format)

Parameters

Input Parameter Name Description
input_date given date in string format
date_format Date Format of the input_date parameter
For more information, refer to the below table Date Format.

Monday is considered as the start and Sunday to be the end of the week.

Sample

  1. Convert string to date format (‘13-10-2020’,‘%d-%m-%Y’) = 13th Oct 2020
  2. Convert string to date format (‘2020/10/05’, ‘%Y-%d-%m’) = 2020 Oct 05th

Date Format

Code Meaning Example
%d Day of the month as a zero-padded decimal number 30
%-d Day of the month as a decimal number (Platform specific) 30
%m Month as a zero-padded decimal number 09
%B Month as locale’s full name September
%b Month as locale’s abbreviated name Sep
%y Year without century as a zero-padded decimal number 20
%Y Year with century as a decimal number 2020

To view all the Date functions, click here.

Did you find what you were looking for?