etime format problem again, thanks!
I have a table named News in sql 2000, and I have a column named publishdate with datetime in News table, I read data through dataset like this:
' DsNews2 is dataset
SqlDataAdapter1.FillSchema(DsNews2, SchemaType.Source, "News")
SqlDataAdapter1.Fill(DsNews2, "News")
Dim tb2 As DataTable
tb2 = DsNews2.Tables("News")
currentID = Integer.Parse(Request.QueryString("ID"))
Dim drCurrent2 As DataRow
drCurrent2 = tb2.Rows.Find(currentID)
Dim pDate As DateTime = drCurrent2("Publishdate")
Dim pdate As String = pDate.ToString()
i put my project in two machine and I got two different value from pdate, one is like:
2005-11-22 0:00:00
the other one is like:
11/22/2005 12:00:00 AM
I wonder I do I make sure that no matter in what machine, the value of pdate alway to be like the first one: 2005-11-22 0:00:00
by the way, can I remove '0:00:00' part?
many thanks for your help!
:(
|