Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Short date formatting problem

Status
Not open for further replies.

777axa

Technical User
Jul 30, 2002
48
US
Here is my function:

Public Shared Function NullDisplay(ByVal nDate As Object)
Dim nString As String
If IsDBNull(nDate) Then
nString = ""
Else
nString = nDate.ToString
End If
Return String.Format("{0:d}", nString)
End Function

It returns a long date ( with minutes & seconds).
I don't understand why because on return I'm using short date formatting.

I need short date (1/1/2000)

Where is my mistake?

Thank you
 
I would use

return nDate.ToShortDate

given that the nDate object is a DateTime var =)

hth Daren J. Lahey
Just another computer guy...
FAQ183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
Support your forums TODAY!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top