SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2009
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to find lastvisited datetime?

    m using c# .net

    i want the date and time that the user last visited the site
    how v can get the lastvisited datetime of user.

    please help.

  2. #2
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For that you have to add a field in DB and at the time user logs in you have to store the dattime in the table. So now when he comes for the next time and logs in you can show last login datetime. For the first time log in you can put current datetime as well.

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2009
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by akki123 View Post
    For that you have to add a field in DB and at the time user logs in you have to store the dattime in the table. So now when he comes for the next time and logs in you can show last login datetime. For the first time log in you can put current datetime as well.
    ok i will try this. but can u tell me how to get the last login datetime..i mean through query? what i have to write for that?

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok. when user logs in before updating the lastlogin date at the time of login first you fetch that users old logindate and put it in variable and than update the field with simple update query. I hope you understand now. there are two queries 1 for selecting the date and the other for updating that field with new value.

  5. #5
    SitePoint Zealot
    Join Date
    Jan 2009
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by akki123 View Post
    ok. when user logs in before updating the lastlogin date at the time of login first you fetch that users old logindate and put it in variable and than update the field with simple update query. I hope you understand now. there are two queries 1 for selecting the date and the other for updating that field with new value.
    ya i got wt u want to say...thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •