FormatDateTime (dateValue, timeValue, formatString)
Rate this function: Average rating: 4.0 (6 votes) Discuss this Custom Function
Lewis C. Lorenz, Attorney at Law
http://www.LorenzCom.com
Returns the dateValue or timeValue formatted as specified in formatString, using PHP-like coding, and allowing for escaped text.
Sample Input:
FormatDateTime ( "12/31/2011", "", "l, F j, Y" )
FormatDateTime ( "12/31/2011", "10:11:25 AM", "Ymd His" )
FormatDateTime ( "12/31/2011", "", "\today is the \dS\ day\" ) |
|
Sample Output:
Saturday, December 31, 2011
20111231 101125
today is the 31st day |
|
Description:
FormatDateTime ( dateValue, timeValue, formatString )
by Lewis C. Lorenz
9-22-2011 Created
11-29-2011 Modified
12-4-11 Modified
Returns the dateValue or timeValue formatted as specified in formatString.
If dateValue or timeValue are empty current date or current time are used.
Optionally use the backslash as an escape code to include text not intended to be formatted.
Escaped \ is written \\, all other escaped text must be enclosed within an opening \ and a closing \.
Formatting performed using PHP date() function format codes but with Filemaker conventions.
Day -------
d - 01-31
D - Mon-Sun
j - 1-31
l (lowercase 'L') - Sunday-Saturday
N - 1 (Monday) ... 7 (Sunday). (PHP convention: ISO-8601 representation of day of week.)
S - st, nd, rd or th (English ordinal suffix.)
w - 1 (Sunday) ... 7 (Saturday). (PHP convention : 0 (for Sunday) through 6 (for Saturday).)
z - 1-366. (PHP convention: 0-365.)
Week -----
W - 1-54, week of year Jan. 1. (PHP convention: ISO-8601 week number of year, weeks starting on Monday.)
Month ----
F - January-December
m - 01-12
M - Jan-Dec
n - 1-12
t - 28-31
Year -----
L - Leap year (1/0)
o - year number. ISO-8601 year number.
Y - 4 digit year
y - 2 digit year
Time ----
a - am/pm
A - AM/PM
g - Hour 1-12
G - Hour 0-23
h - Hour 01-12
H - Hour 00-23
i - Min 00-59
s - Sec 00-59
u - Microseconds
Note: these functions are not guaranteed
or supported by BrianDunning.com. Please contact the individual
developer with any questions or problems.
This is my Custom Function and I want to
edit it
Discuss:There are no comments yet. Be the first to post a comment about this Custom Function! Please try to keep it brief & to the point. Anyone can post:
|
Newest Custom Functions:
| 1. |
ListToggle ( InList ; InValue ) |
| |
(Thu, May 16, 6:59pm) |
| 2. |
VatFormat ( vat ) |
| |
(Tue, May 14, 2:45am) |
| 3. |
CheckVatBE ( vat ) |
| |
(Tue, May 14, 2:32am) |
| 4. |
CheckIBAN (IBAN ) |
| |
(Tue, May 14, 2:24am) |
| 5. |
OrcidCheckDigit ( Orcid_id ; Result ; Iterations ) |
| |
(Wed, May 08, 1:44am) |
| 6. |
DateRangeBySpan ( Begin ; End ; Term) |
| |
(Mon, May 06, 6:53am) |
| 7. |
Convert_Arabic_to_Chinese( number ) |
| |
(Thu, May 02, 6:10am) |
| 8. |
NPVV ( cashFlowList, interestRate ) |
| |
(Sun, Apr 28, 1:56pm) |
 |
|