IrishChieftain
IrishChieftain

Reputation: 15262

Get Date with Day of the Week

What I've got:

<%# ((DateTime)Eval("StartDate")).ToShortDateString() %>

What output I need:

Saturday, 06/28/2012

What's the correct formatting string to use to get this?

Upvotes: 1

Views: 1607

Answers (3)

Manas Bhardwaj
Manas Bhardwaj

Reputation: 11

Microsoft has nicely explained this on MSDN:

<%# ((DateTime)Eval("StartDate")).ToString("dddd, MM/dd/yyyy") %> 

Upvotes: 1

sll
sll

Reputation: 62564

Try out "dddd, MM/dd/yyyy"

See Custom Date and Time Format Strings on MSDN

Upvotes: 0

Andrei
Andrei

Reputation: 56726

Try this one:

<%# ((DateTime)Eval("StartDate")).ToString("dddd, MM/dd/yyyy") %>

Link for further reference: custom time and date formats.

Upvotes: 5

Related Questions