User Tools

Site Tools


syntax:functions:date

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
syntax:functions:date [2015/04/03 20:52] elenapsyntax: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.
  
- Example   Result  +\\  
- date('20140101','yyyyMMdd'  41640  | +=====Arguments===== 
-|  date('14-01-01','yy-MM-dd' |  41640  +^Argument^Type^Description
-|  date('20140101','yy-MM-dd'    |  #Can't convert to date  |+|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 === +\\  
-Case-sensitive.+==== Format string components ==== 
 +The components below are case-sensitive.
 ^  Character  ^  Description  ^ ^  Character  ^  Description  ^
 |  d  |The day of the month, from 1 through 31.  | |  d  |The day of the month, from 1 through 31.  |
Line 23: Line 29:
 |  yyyy  |The year as a four-digit number.  | |  yyyy  |The year as a four-digit number.  |
  
-=== See also === +\\  
-  * [[https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx|MSDN: Custom Date and Time Format Strings]]+=====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:makedate]]
   * [[syntax:functions:format]]   * [[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