Wrong date displayed

4 posts, 0 answers
  1. Gilbert van Veen
    Gilbert van Veen avatar
    68 posts
    Member since:
    Oct 2009

    Posted 04 Nov 2009 Link to this post

    Hi,

    First I want to explain that I totally new to the Telerik products. After a test with the trial version we have decided to buy (now two days ago) we bought the whole Telerik suite. So, this question may sounds silly.

    In the MySql table I have a DATA field which containts 02-09-2009 (Dutch format for the second of september 2009). In my telerik grid this data is shown as 01-09-2009? The same happens for the datepicker on a childform. For some reason the date format does a strange thing.

    Should I set the display format for the column and or the datepicker and how should I do it?

    Thanks in advance,

    Please note my XAML file for the grid there is already the following:

    <

     

    telerik:GridViewDataColumn DataMemberBinding="{Binding BirthDate}" DataFormatString="{}{0:dd/MM/yyyy}"></telerik:GridViewDataColumn>

     

     


    This is the correct Dutch format but still it shows the wrong date on the screen.
  2. Stefan Dobrev
    Admin
    Stefan Dobrev avatar
    790 posts

    Posted 06 Nov 2009 Link to this post

    Hi Gilbert,

    I tried to replicate your scenario, but everything works as expected. Can you send us a small sample project that illustrates your case exactly so we can verify it locally?

    Sincerely yours,
    Stefan Dobrev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. uku
    uku avatar
    57 posts
    Member since:
    Mar 2009

    Posted 11 Nov 2009 Link to this post

    Hello Stefan,

    I'm also interested in this subject. I have the same problem with German date format which is 02.09.2009 for the second of september. I guess it's not a Telerik datepicker problem because I had the same issue with the datepicker of the Microsoft toolkit. I think it has something to do with culture settings.

    I'm working on an English vista, with an English Visual Studio, an English IE8 and with an English SQL Server, but my formats and location settings in vista are German (Germany).
    I thought it could be a problem with database settings, because when selecting the date in the datepicker it seems ok but it was written wrong to the database but if Gilbert has the same issue with his MySQL table than this is probably the wrong path to follow.

    By the way I'm using the DateTime data type for the column in SQL Server and not one of the new data types.

    I hope you will find a solution to this problem even if it might be not a Telerik specific problem. I think it would be a great idea for a blog entry about internationalization. Not just using different languages but also what needs to be considered if an app should be hosted for customers in different countries, which means different OS and browser languages different format and culture settings.

    Bye

    Uwe
  5. Gilbert van Veen
    Gilbert van Veen avatar
    68 posts
    Member since:
    Oct 2009

    Posted 04 Mar 2010 Link to this post

    I think the problem has to due with the fact that the DateTime value in the MSSQL table is not filled with a complete DateTime value. In my case I only store the Date and the time is set to null. This is done because I don't need the time.

    When I changed my code and instead of the null value for the time, I add a fixed time 23:59:59 then every component (Grid and DateTime picker) are shown the correct date values.

    I don't know if this is logic or that it needs a little change to the Telerik components to "catch" these cases? Nevertheless I solved it for now.

    So now I store the date like this: 01-03-2010 23:59:59

    Case closed :)
Back to Top