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 [2015/02/01 14:18] dmitry
Line 2: Line 2:
  
 Converts //date_as_text// into date represented as number according to //format// string. Converts //date_as_text// into date represented as number according to //format// string.
 +
 +^  Example  ^  Result  ^
 +|  date('20140101','yyyyMMdd' |  41640  |
 +|  date('14-01-01','yy-MM-dd' |  41640  |
 +|  date('20140101','yy-MM-dd'     #Can't convert to date  |
 +
 +
 +=== Format string components ===
 +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.  |
 +
 +=== See also ===
 +  * [[https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx|MSDN: Custom Date and Time Format Strings]]
 +  * [[syntax:functions:makedate]]
syntax/functions/date.txt · Last modified: 2023/11/24 21:06 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki