Date error while adding new element

Apr 23, 2008 at 10:18 PM
When I add a new element and the date format is like "2008-04-24 00.08" an error appear near the date:
Please enter a valide date (yyy-mm-dd hh:mm).

If I change the date in "2008-04-24 00:08" the follow error page appear:


DateTime not valid

Row 149: txtContent.Text = "No text";
Row 150:
Row 151: post.DateCreated = DateTime.ParseExact(txtDate.Text, "yyyy-MM-dd HH:mm", null).AddHours(-BlogSettings.Instance.Timezone);
Row 152: post.Author = ddlAuthor.SelectedValue;
Row 153: post.Title = txtTitle.Text.Trim();

File: d:\inetpub\...admin\Pages\Add_entry.aspx.cs Riga: 151



FormatException: Stringa non riconosciuta come valore DateTime valido.
System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style) +2240186
System.DateTime.ParseExact(String s, String format, IFormatProvider provider) +30
adminentry.btnSaveClick(Object sender, EventArgs e) in d:\inetpub\webs\lucasgardenit\admin\Pages\Add_entry.aspx.cs:151
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102


Please, someone can help me?

Thank You very much.

Lucas.