Vinnie

Vinnie

  • NA
  • 11
  • 0

C# date formating problem

Sep 4 2007 2:37 PM

Hi,

I would like to get dd/mm/yy 23:59 format of my date in the text box in aspx.cs code.

First, I select the date from the database into textbox as dd/mm/yy hh:mi, and then
I have to transform it to dd/mm/yy 23:59

Now I do this with this code

string MyDate    //which I get from the function and then

textbox1.Text = MyDate.Remove(9)+ "23:59";

Do you know some better solution to do the same but without remove ?

Also, when user insert date like dd/mm/yy without hh:mm, I would like to change it to

"dd/mm/yy 23:59".

How can I check whether the hh:mm part is not inserted ?

Thanks a lot !


Answers (5)