day

Returns the day of a given date string, s.

Syntax

R = day(s)

R = day(s, fmt)

Inputs

s
A string representing a date. By default, if no fmt is specified, s is expected to be in the format dd-mmm-yyyy.
Type: string
fmt (optional)
Returns the given format that s is in. Valid formats that can return day are:
  • 'dd-mmm-yyyy HH:MM:SS'
  • 'dd-mmm-yyyy' 'mm/dd/yy'
  • 'mm/dd'
  • 'dd/mm'
  • 'dd/mm/yy'
  • 'mmm.dd,yyyy HH:MM:SS'
  • 'mmm.dd,yyyy'
  • 'mm/dd/yyyy'
  • 'dd/mm/yyyy'
  • 'yy/mm/dd'
  • 'yyyy/mm/dd'
  • 'yyyy-mm-dd'
  • 'yyyymmddTHHMMSS'
  • 'yyyy-mm-dd HH:MM:SS'
Type: string

Outputs

R
Returns the day from the given date string s
Type: integer

Examples:

Return the day from a date string in the default date format:
R = day('10-Apr-2019')
R = 10
Return the day from a day string in the specific date format:
R = day('Apr.04,2019 10:11:12', 'mmm.dd,yyyy HH:MM:SS')
R = 4