Actually,I'm developing a Clinic Management System where in one screen,I need to show Today's Patients which are added in the Queue.
For this : I've called DateTime.Now;
Actually My host server is in Canada Location and I'm in Malaysia.So,there is a 12 hour gap between both and the records are not showing until 12 pm.
While googling for the solution,I came across a solution through JavaScript.
<label id="lblTime" runat="server" style="font-weight: bold"></label>
<script type="text/javascript">
$(document).ready(function () {
ShowTime();
});
function ShowTime() {
var dt = new Date();
document.getElementById("lblTime").innerHTML = dt.toLocaleTimeString();
window.setTimeout("ShowTime()", 1000); // Here 1000(milliseconds) means one 1 Sec
}
</script>
Actually,It is showing time but when I get the text on the code behind,it is giving me an empty string.
string strrr = lblTime.InnerHtml.ToString();
Can anyone guide me through this? Am I doing any Mistake? Is there any other way to do this?
Actually,I need the Date&Time in !isPostback
of Page_load