Converting Dates
-
Any idea how I can get his to read for example September 2002 <%# DataBinder.Eval(Container.DataItem, "CompletionDate")%>
Assuming
CompletionDate
is stored as aDateTime
object, try:DataBinder.Eval(Container.DataItem, "CompletionDate", "MMMM yyyy")
NB: The case is important -
M
means month,m
means minutes.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Assuming
CompletionDate
is stored as aDateTime
object, try:DataBinder.Eval(Container.DataItem, "CompletionDate", "MMMM yyyy")
NB: The case is important -
M
means month,m
means minutes.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
hmm tried that by editing the line to the following <%# DataBinder.Eval(Container.DataItem, "CompletionDate", "MMMM yyyy")%> yet it just prints out MMMM yyyy instead of any date
Whoops! :-O That should be:
DataBinder.Eval(Container.DataItem, "CompletionDate", "{0:MMMM yyyy}")
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Whoops! :-O That should be:
DataBinder.Eval(Container.DataItem, "CompletionDate", "{0:MMMM yyyy}")
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer