Bug...once logged in, My Current Ads Posted date is wrong

Last post 06-24-2009 7:20 PM by Spider Master. 5 replies.

Sort Posts:

  • Bug...once logged in, My Current Ads Posted date is wrong

    06-21-2009, 6:24 PM

    Once logged in and select My Ads and Profile, under my Current Ads section, the Posted Date is wrong.  I didn't make any changes to it.  Can someone help?

     Thanks!

  • Re: Bug...once logged in, My Current Ads Posted date is wrong

    06-21-2009, 7:53 PM
    • Contributor
      7,249 point Contributor
    • whighfield
    • Member since 01-02-2006, 10:37 PM
    • Winterpeg, Manitoba
    • Posts 1,205

    Might be a trivial question but is your database in the same timzone as you?  If not then that is why, your database server has a different clock time than your computer does, when you save it saves for the server time.

    Please mark the most helpful reply/replies as "Answer".

    - William
    http://thefrozencoder.ca
  • Re: Bug...once logged in, My Current Ads Posted date is wrong

    06-21-2009, 11:40 PM

    How do I find out what time zone my database is in?  I think you r right.  How do change it?

  • Re: Bug...once logged in, My Current Ads Posted date is wrong

    06-22-2009, 12:51 AM
    • Contributor
      7,249 point Contributor
    • whighfield
    • Member since 01-02-2006, 10:37 PM
    • Winterpeg, Manitoba
    • Posts 1,205

    You won't be able to change it since you would have to change the clock on the server (I assume that you have a hosting account).  What you will have to do is when ever you save or retrive dates from the database you will have to convert the datetime to your timezone.  This will require you to either add or subtract hours on the date.  If you have access to your database and can execute Sql statements you can use the GETDATE() to find out what the current date on the server is then just adjust your code to add/subtract the difference.

    Please mark the most helpful reply/replies as "Answer".

    - William
    http://thefrozencoder.ca
  • Re: Bug...once logged in, My Current Ads Posted date is wrong

    06-22-2009, 6:27 AM

    I query the database and the time zone is correct with my time zone.  To give you a better idea of my problem....I created an ad on 6/22/09 at 3:11 AM.  When I log in a view  my Current Ads, the Posted Date is

    22/11/09.   From the looks of it...the format is dd/mm/yy.  The Month doesn't make sense. I just created another ad at 3:25AM.  The Posted date is 22/23/09.  Can any make sense of it?
  • Re: Bug...once logged in, My Current Ads Posted date is wrong

    06-24-2009, 7:20 PM
    Answer
    • Participant
      1,580 point Participant
    • Spider Master
    • Member since 10-16-2007, 1:32 PM
    • New Zealand
    • Posts 452

    This sounds like a case of the 2008 BETA version bugs in the classifieds starter kit downloaded from this site that have been experinced by many for the past 2years and nothing has been done about it.

    There are various places on the net you can download the 2006/7 final release. google it.

    Anyway if you want to get past this and maybe your site is like mine where you will have people from different timezones making use of your site follow these steps.

    1. On the create new ad page find and locate any DateTime.Now and replace with DateTime.Now.ToUniversal()
    2. Follow the Proccedure that inserts this into the database and also replace time stamps ToUniversal()
    3. The database should not be creating any timestamp objects so there should not be any problems there with the SQL servers set time.
    4. Check all the get proceedures to ensure they all correctly and directly get the DateTime object from the database.
    5. Check that the database is recording (set/get) all DateTime objects as "smalldatetime"

    5 is where the most likely problem is however i recommend all the checks are made here and not only on listings.

    Ok so now I believe you should have accurate DateTime recording (from the asp.net servers set time) If you wish to display this time back into the users Timezone there are a few more steps to take but at least for now the problem should be gone.

    I have not tested this and has been some time since i had to overcome the same issue with the kit so please make a backup of your existing work.

    Trading Center is a New Classifieds Starter Kit on Code Plex.

    "If Your Question Has Been Answered, Please Mark It As the Answer"

Page 1 of 1 (6 items)