Asp.Net Time Format 12-Hour With AM/PM

In Asp.net Time  Format
Label1.Text = DateTime.Today.ToString(“hh:mm tt”);

Sql server Only Select Time

SELECT REPLACE(REPLACE(RIGHT(‘0’+LTRIM(RIGHT(CONVERT(varchar,getDate(),100),7)),7),’AM’,’ AM’),’PM’,’ PM’)as Date

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s