Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
I want to show date and time show when I publish a article.

for example when I post in Facebook they are posting with current date/time.

same to same I want to show date and time.
Posted
Updated 24-Oct-15 19:14pm
v2
Comments
ZurdoDev 24-Oct-15 22:46pm    
What is your question?
Where is the issue then?

Add a new column in your table where you are storing the articles named DateTime (datetime) and set the default value to (getdate()). And you are done.

For more check these one.
http://i.stack.imgur.com/BuuTd.jpg[^]

http://stackoverflow.com/questions/4888277/add-default-value-of-datetime-field-in-sql-server-to-a-timestamp?answertab=active#tab-top[^]
 
Share this answer
 
As you haven't shared what have you done so far, it's hard to tell what you can with your current code.

So follow this,
You need to add one column name as PostDate in your table and type it as DateTime.
Now using your code, while uploading/inserting your article details in the database, you can use DateTime.Now for the PostDate.


-KR
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900