Monday, February 15, 2010

Date Format, C#

Date FromatOutput
dd-MMM-yyyy15-Feb-2010
dd-MM-yyyy15-02-2010
dd-MMM-yyyy hh:mm:ss15-Feb-2010 11:25:56
dd-MMM-yyyy hh:mm tt15-Feb-2010 11:25 AM
dd-MMM-yy15-Feb-10
MMM dd, yyyyFeb 15, 2010
MMMM dd, yyyyApril 15, 2010


Example:
DateTime objDt = DateTime.Now;
objDt.ToString("dd-MMM-YYYY") = 15-Feb-2010

No comments: