User Tools

Site Tools


syntax:functions:date

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
syntax:functions:date [2015/02/01 13:55] – created dmitrysyntax:functions:date [2021/07/31 01:10] craigt
Line 1: Line 1:
-===== Date(date_as_text, format) =====+====== Date(date_as_text, format) =====
 +Category:  Date and Time function
  
-Converts //date_as_text// into date represented as number according to //format// string.+\\  
 +=====Description===== 
 +This function converts //date_as_text// into date represented as number according to //format// string. 
 + 
 +\\  
 +=====Arguments===== 
 +^Argument^Type^Description^ 
 +|date_as_text  |Text  |The text value, representing a date, to be converted into a date serial number.| 
 +|format  |Text  |The layout of the //date_as_text// value describing the order and type of components.  See the "Format string components" table below.| 
 + 
 +**Return value type:** Number (date serial value). 
 + 
 +\\  
 +==== Format string components ==== 
 +The components below are case-sensitive. 
 +^  Character  ^  Description 
 +|  d  |The day of the month, from 1 through 31.  | 
 +|  dd  |The day of the month, from 01 through 31.  | 
 +|  ddd  |The abbreviated name of the day of the week.  | 
 +|  M  |The month, from 1 through 12.  | 
 +|  MM  |The month, from 01 through 12.  | 
 +|  MMM  |The abbreviated name of the month. 
 +|  MMMM  |The full name of the month. 
 +|  y  |The year, from 0 to 99.  | 
 +|  yy  |The year, from 00 to 99.  | 
 +|  yyyy  |The year as a four-digit number. 
 + 
 +\\  
 +=====Remarks===== 
 +This function returns the date serial number of the date input, but //displays// it as a readable date.  For example, January 1st, 2014 is represented as //41640// numerically.  EasyMoprh then displays this value as a readable date:  01-Jan-2014.  Under the hood, the actual value is 41640. 
 + 
 +To see the date serial number in a column of dates, right-click the column's heading and select "Filter/Profile"  In the Filter/Profile window, select the "Metadata" tab.  In the "Number format" drop-down, select the "1000" format to have the date serial number display in the column instead of the formatted date.  Switch back to one of the date formats to view the values as a date. 
 + 
 +\\  
 +=====Examples===== 
 + 
 +  date('20140101', 'yyyyMMdd') = 41640  //Displays as 01-Jan-2014 
 +  date('14-01-01', 'yy-MM-dd') = 41640  //Displays as 01-Jan-2014 
 +  date('30/12/2000', 'dd/MM/yyyy') = 44556  //Displays as 30-Dec-2000 
 +  date('20140101','yy-MM-dd') = #Can't convert to date 
 + 
 +\\  
 +===== See also ===== 
 +  * [[syntax:functions:makedate]] 
 +  * [[syntax:functions:format]] 
 +  * [[https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx|MSDN: Custom Date and Time Format Strings]]
syntax/functions/date.txt · Last modified: 2023/11/24 21:06 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki