DateTimeFormat

  • Thread starter Thread starter Karunakararao
  • Start date Start date
K

Karunakararao

Hi All


Date/Time: 9/29/2004 6:02:13 PM

This date and time Iam getting from Database,but I want to remove
seconds ":13"
Just I want to remove this Like ":13".
I want like this : 9/29/2004 6:02 PM

Please help me.

Regards
Venu
 
This is one way: String.Format ("{0:MM/dd/yyyy hh:mm}", <data column
reference>)

Hi All


Date/Time: 9/29/2004 6:02:13 PM

This date and time Iam getting from Database,but I want to remove
seconds ":13"
Just I want to remove this Like ":13".
I want like this : 9/29/2004 6:02 PM

Please help me.

Regards
Venu
 
Here Dates we are populating based on Regional optional settings that's
why we can not formating the Dates.
With out formating how can i Remove the Second's

Regards
Venu
 
Perhaps, this way?
int i = DateString.LastIndexOf(":");
string SecRemovedStr = DateString.Remove (i, 3); // Assuming seconds always
in two digits.

Here Dates we are populating based on Regional optional settings that's
why we can not formating the Dates.
With out formating how can i Remove the Second's

Regards
Venu
 
Back
Top