Re: ASP.Net [2.0] - Converting a date to a new format...

Tech-Archive recommends: Speed Up your PC by fixing your registry



"Jan Hyde" wrote ...

I'm not clear what the problem is, you appear to be saying
you want date variables to act like formatted strings and
that ain't gonna happen.

Hi Jan, thank you for your reply.

Clearly I didn't explain myself very well...my apologies.

What does it matter how the data variable holds the date?
Aren't you displaying the date in the format you desire anyway?

I have the date stored in the database and my class as a date, it also has
the time etc...

What I want to be able to do on my web page is say this:

"Last updated: 22/05/2006 11:46"

what I dont want is this:

"Last updated: 05/22/2006 11:46:01 AM" or whatever else it feel like adding
etc :)

What I used to be able to do was this:

Response.Write (myDate.ToString("dd/MM/yyyy HH:mm")

and I get exactly that:
22/05/2006 11:46

I am unable to do this now in .net 2.0 - the ToString function does not give
you the format stuff in the brackets, instead I get an "index" instead?
whats a bit weird is that I can type..

..ToString.ToString("dd/MM/yyyy") - not that it worked, but I thought it odd
I could tostring a tostring??!

Is any of this any clearer?

Regards

Rob

PS: What do you use to configure that reply at the top?
ie,


.



Relevant Pages

  • Re: Egypt anyone?
    ... >> Apologies for the fucked up format of that last post. ... > No probs, Thanks for the info. ... > Sharm does seem to be becoming a major tourist centre and hence a big ...
    (uk.rec.motorcycles)
  • Re: Are black men quitters?
    ... My apologies for the last post. ... I am new to this format and ... We generally mark off-topic threads as such, ...
    (alt.tv.survivor)
  • Re: Are black men quitters?
    ... | My apologies for the last post. ... I am new to this format and ... think the fishing trip is more like the camping trip on "Brokeback ...
    (alt.tv.survivor)
  • Re: Are black men quitters?
    ... | My apologies for the last post. ... I am new to this format and ... think the fishing trip is more like the camping trip on "Brokeback ...
    (alt.tv.survivor)
  • Re: Are black men quitters?
    ... | My apologies for the last post. ... I am new to this format and ... think the fishing trip is more like the camping trip on "Brokeback ...
    (alt.tv.survivor)