×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    101

    DateField Strange Behaviour

    When I set the Date "01 / 01 / 1500" in a DateField

    The Result of MY code
    Code:
           InputDate = dateField.getDate();
           stringItem1.setText(InputDate.toString());
    The Result is 22/12/1499 which is 10 days before.
    It does thae same for any Date before 1/1/1583

    how can I get the correct Entered Date.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: DateField Strange Behaviour

    You may have problems with dates this far back in time. Ten days is the difference between the Julian Calendar (used in Europe before 1582) and the Gregorian Calendar (adopted in most Catholic parts of Europe since 1582, in the British Empire in 1752, in Russia in 1918 and Greece in 1923).

    You must remember that, in Europe, it was different dates in different countries, between 1582 ad 1923. For any date between those years, you need to know what country you are (were) in before you can understand what date it was.

    Certain dates simply never existed in many countries. In Italy, for example, 4th October 1582 was followed by 15th October 1582. The dates from 5th-14th of October 1582 never existed in Italy. However, the day that was 15th October 1582 in Italy was called 5th October 1582 in England.

    The DateField you are using is treating any date before 1583 as Julian, and from 1583 onwards as Gregorian.

    Does that make any sense?

    Graham.

  3. #3
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    101

    Re: DateField Strange Behaviour

    Thanks For Info.

    I Tried to add 10 days , To Get the The same Entered Date.
    Code:
            InputDate = dateField.getDate();
            ResultCalnder.setTime(InputDate);
            ResultCalnder.add(Calendar.DATE, 10);
    But There is an Error
    cannot find symbol
    symbol : method add(int,int)
    location: class java.util.Calendar
    ResultCalnder.add(Calendar.DATE, 10);

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: DateField Strange Behaviour

    Calendar has no "add()" method.

    Why do you want dates back in the 1500s?

  5. #5
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    101

    Re: DateField Strange Behaviour

    I am trying to make an App to convert Calenders

    I found this code works
    Code:
            InputDate = dateField.getDate();
            long DateLong = InputDate.getTime();
            
                final long MILLIS_PER_DAY = 24 * 60 * 60 * 1000L;
                DateLong += 10 * MILLIS_PER_DAY;
                ResultCalnder.setTime(new Date(DateLong));

Similar Threads

  1. Strange behaviour of RConnection::Start() on N93 (S60 3rd) ?
    By Suyash in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2008-07-23, 11:32
  2. CAknMultiLineDataQueryDialog - strange behaviour on E61
    By MiKeL in forum Symbian User Interface
    Replies: 4
    Last Post: 2007-05-28, 08:30
  3. S60, text messaging - can someone with an s60 check out this strange behaviour for me
    By cjard in forum Series 40 & S60 Platform Feedback Archive
    Replies: 0
    Last Post: 2007-05-08, 13:24
  4. Replies: 3
    Last Post: 2006-07-20, 07:13
  5. Strange UI behaviour N90
    By mateen_maldar in forum Symbian User Interface
    Replies: 3
    Last Post: 2006-05-14, 10:21

Posting Permissions

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