CREATE TABLE UserLogin (
ID INT IDENTITY(1,1) PRIMARY KEY NOT NULL,
UserName NVARCHAR(20),
LoginDate Date,
LoginTime Time
)
IF YOU INSERT DATA WITH THE USE OF STOREPROCEDURE THEN USE THIS AS YOUR PROCEDURE
DECLARE @userName NVARCHAR(20);
INSERT INTO UserLogin (UserName,LoginDATE,LoginTIME) VALUES (
@userName,
cast(convert(varchar,getdate(),101) as date),
cast(convert(varchar,getdate(),108) as time)
)
or you want it from your code behind page or c#
then use this
DateTime.Now.ToShortDateString();
DateTime.Now.ToShortTimeString();
For More Detail on DateTime and Convert or Cast see this link
DateTime[
^]