Search

Current Date And Time String

Articles

Use this function to fetch the current date and time according to the input format.

Syntax

Current Date And Time String (date_format)

Parameters

Input Parameter Name Description
date_format Date format to be provided.
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. Current Date And Time String (%d/%m/%Y) = 28/11/2020
  2. Current Date And Time String (%y-%m-%y) = 18-11-20
  3. Current Date And Time String (%Y.%d.%m) = 2020.28.11

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?