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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date time field show only time 1

Status
Not open for further replies.

dinster

Programmer
Apr 12, 2007
54
GB
Hi all i have access database connected to myp aspx webpage. I used dreamweaver. When i store the time through an aspx form. It saves it in access database table field. I set the field to show short time field.

How ever when i retrieve the record through my aspx form it shows the date and time?

PARAMETER
Code:
<Parameter Name="@TimeAdded" Value='<%# IIf((Request.Form("TimeAdded") <> Nothing), Request.Form("TimeAdded"), "") %>' Type="Date" />


textbox
Code:
<asp:textbox ID="TimeAdded" Text='<%# DataSet1.FieldValue("TimeAdded", Container) %>' TextMode="SingleLine" Columns="20" runat="server" />

i just want it to show short time i.e 22:54?

many thanks
 
Try one of these:
Code:
<%# DataSet1.FieldValue("TimeAdded", Container)[!].ToString("hh:mm")[/!] %>
Code:
<%# [!]String.Format([/!]DataSet1.FieldValue("TimeAdded", Container)[!], {0:t})[/!] %>
Code:
<%# [!]String.Format([/!]DataSet1.FieldValue("TimeAdded", Container)[!], {"hh:mm"})[/!] %>


-------------------------------------------------------

Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Delivering professional ASP.NET solutions
[URL unfurl="true"]http://weblogs.asp.net/marksmith[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top