I have a code in asp.net, where the user enters the date selection throught an AJAX calendar pop-up control as per below:
<td class="style14">
<asp:TextBox ID="DateSelection" runat="server" Height="22px" Width="90px"
AutoPostBack="True"></asp:TextBox>
<asp:ImageButton ID="ImageButtonDateSelection" runat="server" Height="22px"
ImageUrl="~/Images/Calendar.jpg" Width="19px" />
<asp:CalendarExtender ID="CalendarExtenderDateSelection" runat="server"
Format="dd/MM/yyyy" PopupButtonID="ImageButtonDateSelection"
PopupPosition="BottomRight" TargetControlID="DateSelection"
FirstDayOfWeek="Monday">
</asp:CalendarExtender></td>
From SQL I pickup the date and use it in the SQL code as follows:
declare @dt datetime
set @dt = convert(datetime,'" & DateSelection.Text & "',104
All is well in my remote desktop, but when I publish the site it doent' work due to diferent date formats on server.
I can not figure out what format the server has, but I'm wondering if there is a fool proof way to work with any date format, so that I can develop on my pc with my date format and send the code safely to the server and warantee that it will work. Thanks.