Home : DFORMAT
Q11215 - INFO: DFORMAT

DFORMAT returns a formatted date.   

SYNTAX:

DFORMAT(Date,Format)

Date: A string representing a valid date, i.e. "1/2/2004", a cell reference to a cell containing a date string, or a function that returns a date string (such as DSORT).  Function will also allow times in the following formats - hhmm,hmm,hh.mm,h.mm (see examples below).

 Format: Date Format (i.e. "mm/dd/yyyy"...) to return. 

NOTES:

Returns a Text string.  Cell type will be changed to Text when using this formula.

EXAMPLES:

DFORMAT("5/1/07","ddd") returns Tue

DFORMAT(B3,"yyyy") returns 2008 where cell B3 contains "1/15/2008"

DFORMAT("1245","hh:mm AMPM") - Returns 12:45 PM, assumes miltary time is the input.

DFORMAT(44000,"m/d/yyyy") - Returns 6/18/2020.  The number 44000 represents the number of days since 12/30/1899.  Note you can take the VAL of a date to return this number (IE VAL("6/18/2020") returns 44000. 

DFORMAT(44000.5,"m/d/yyyy hh:mm") - Returns 6/18/2020 12:00.  The decimal portion represents the part of the day, i.e. .5 is half the day (noon).  

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 5/9/2008 4:00 PM.
Last Modified on 10/28/2020 2:24 PM.
Last Modified by Scott Dorner.
Article has been viewed 4386 times.
Rated 4 out of 10 based on 4 votes.
Print Article
Email Article