Tuesday, October 21, 2008

Date , day , month year in Sql-server and asp.net c#

Date , day , month year in Sql-server and asp.net c#
sql-server
select DATEPART(yyyy, getdate())
select DATEPART(dd, getdate())
select DATEPART(mm, getdate())
select convert(varchar,getdate(),101)
int streventday = DateTime.Now.Day;
int streventmnt = DateTime.Now.Month;
int streventyear = DateTime.Now.Year;
string strdate DateTime.Now.ToString("MM/dd/yyyy");


No comments: