PgSqlTimeStamp Formatting
Posted: Tue 18 May 2010 23:14
I wonder if this is a question for you.
I have a PgSqlTimeStamp value that is assigned to a textbox control but I want to format it so it appears as dd/mm/yyyy hh:mm:ss.
The time portion should display AM/PM.
I have used the following code but I am sure there must be a better option:
txtFechaReg.Text = SeccEspMedia.FechaReg.Day.ToString() + "/" +
SeccEspMedia.FechaReg.Month.ToString() + "/" + SeccEspMedia.FechaReg.Year.ToString() + " " +
SeccEspMedia.FechaReg.Hour.ToString() + ":" + SeccEspMedia.FechaReg.Minute.ToString() + ":" +
SeccEspMedia.FechaReg.Second.ToString();
Respectfully,
Jorge Maldonado
I have a PgSqlTimeStamp value that is assigned to a textbox control but I want to format it so it appears as dd/mm/yyyy hh:mm:ss.
The time portion should display AM/PM.
I have used the following code but I am sure there must be a better option:
txtFechaReg.Text = SeccEspMedia.FechaReg.Day.ToString() + "/" +
SeccEspMedia.FechaReg.Month.ToString() + "/" + SeccEspMedia.FechaReg.Year.ToString() + " " +
SeccEspMedia.FechaReg.Hour.ToString() + ":" + SeccEspMedia.FechaReg.Minute.ToString() + ":" +
SeccEspMedia.FechaReg.Second.ToString();
Respectfully,
Jorge Maldonado