Questions about formating Dates

  • Thread starter Thread starter Cal Who
  • Start date Start date
C

Cal Who

I found documentation for this way to format a date:
endtime.ToString("dddd, MMM d yyyy")

But I can't find an explanation of this method:
<%#Eval("CreateDate", "{0:d}")%>

The first on produces Saturday, Apr 3 2010
Note no comma after the 3?
Can I make it add a comma?

The second one produces:
Friday, April 02, 2010
Can I supress the leading zero?


Best for me would be in both cases:
Friday, April 2, 2010
Can I do that?


Thanks
 
I never did find info about the Eval syntax but I managed to answer my
questions anyway.
It's possible to replace the d with a format string (no quotes around it)
 
Cal Who said:
I never did find info about the Eval syntax but I managed to answer my
questions anyway.
It's possible to replace the d with a format string (no quotes around it)

You may want to read up on formatting, any documentation ought to explain
what's going on there.
 
Andy O'Neill said:
You may want to read up on formatting, any documentation ought to explain
what's going on there.

I couldn't find any for {0:d}
Probably right there but I couldn't find it.


Thanks
 
That was just a Google search which I had done many times. I never did find
and example with a 0 (zero) in it.\

Thanks
 
3rd on my list was
4 guys from rolla specifically explains the 0 is a placeholder and the
letter a standard format to apply.
4th has a whole bunch of examples with zeroes in them.
I got bored after that.
 
My browser tells me I skipped the 3rd one but I did open the 4th one.
Why I didn't see the zeros I don't know.
Maybe by then (I had looked before) I didn't expect to see any and only saw
what I expected.

Thanks for your patience.
 
Cal Who said:
My browser tells me I skipped the 3rd one but I did open the 4th one.
Why I didn't see the zeros I don't know.
Maybe by then (I had looked before) I didn't expect to see any and only
saw what I expected.

Thanks for your patience.

No problem.
Always happy to help a fellow developer.
 
Back
Top