Jun 21, 2010, 11:15 AM
Timefield Problem(am/pm)
Hi all.....
i have a time field in window..i have written a code in Page load(.cs file) to display the current time(means whenever user log in ,
it should display the system time or log in time(am/pm)).. It is displaying the right time, i logged in at 9:00 AM but it is displaying
9:00 PM.. plz solve the problem..
i have a time field in window..i have written a code in Page load(.cs file) to display the current time(means whenever user log in ,
it should display the system time or log in time(am/pm)).. It is displaying the right time, i logged in at 9:00 AM but it is displaying
9:00 PM.. plz solve the problem..
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<ext:ScriptManager ID="knkldjf" runat="server" InitScriptMode="Inline" CleanResourceUrl="false" ></ext:ScriptManager>
<ext:Window ID="windowtime" runat="server" Width="400" Height="100" Centeronload="true">
<Body>
<ext:TimeField ID="tmTime" runat="server" Format="hh:mm tt" />
<%--<ext:TextField ID="txtTime" runat="server" Width="200" />--%>
</Body>
</ext:Window>
</form>
</body>
</html>
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Coolite.Ext.Web;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// txtTime.Text = Convert.ToString(DateTime.;
tmTime.SelectedValue = Convert.ToString(DateTime.Now.TimeOfDay);
//ddlFromValidTime.SelectedTime = DateTime.Now.TimeOfDay
}
}