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

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Rob Meade" <ku.shn.tsews.thbu@xxxxxxxxx>'s wild thoughts
were released on Mon, 22 May 2006 15:28:31 +0100 bearing the
following fruit:

"Jan Hyde" wrote ...

OK, can you show us how 'mydate' is declared because I don't see "index"

okey dokey - I'll post it up this evening, its on my laptop at home at the
moment....if its of any help - I can roughly remember (but will still post
this evening).,..

My "User" class has a class variable

Private _profileLastUpdated AS Date

I also have a property for that..

Public Property ProfileLastUpdated As Date
Get
...
Set
..
End Property

I populate this via my data access layer....

Where I have a function that populates a datatable, a item is taken from the
row and pushed into the property of my User class...

Something like this:

User.ProfileLastUpdated = DataTable.Rows(0).Item("ProfileLastUpdated")

I think thats about it - as I said I'll post the code up propertly this
evening, but that all feels familiar to me....

On the web page I then have a label which I populate on my page load (or at
least a function called from the page load)....

lblProfileLastUpdated = "Last updated: " & User.ProfileLastUpdated

that would give me...

Last Updated: 22/05/2006 15:27:00

I basically want to lose the seconds from that - and a character mangling
solution wasn't really what I wanted (ie, using LEFT / RIGHT / LEN) -as I'd
used the format part of .ToString before I assumed it would work fine here
too...

Regards

Rob

I tried to mimic your setup but I still get the option to
provide a format string. I just know this is gonna be
something so simple we'll both kick ourselves.




Jan Hyde (VB MVP)

--
Metallurgist: Someone who is allergic to iron. (Leo Roston)

.



Relevant Pages