Coder Social home page Coder Social logo

Comments (3)

curioustechizen avatar curioustechizen commented on May 23, 2024

@erikswed The library does not calculate the time, we just use DateUtils. Could you try creating a simple app using getRelativeTimeSpanString(long, long, long, int) from that class and see what it prints?

from android-ago.

curioustechizen avatar curioustechizen commented on May 23, 2024

@erikswed Have you gotten a chance to try out the DateUtils class yet?

from android-ago.

erikswed avatar erikswed commented on May 23, 2024

UPDATE:
It was my tablet kitkat Galaxy Tab 3 that need a system reset I think because everything look ok on the Android emulator api19 kitkat

Hmm
I cant figure this out right away very strange. I do as you say creating a test project here is the relevant code

        Long mReferenceTime = 1509262481035L; // 14 minutes ago
        RelativeTimeTextView timestampView1 = findViewById(R.id.timestamp1);
        TextView timestampView2 = findViewById(R.id.timestamp2);

        timestampView1.setReferenceTime(mReferenceTime);
        long now = System.currentTimeMillis();
        long difference = now - mReferenceTime;

        timestampView2.setText(DateUtils.getRelativeTimeSpanString(mReferenceTime,
                now,
                DateUtils.MINUTE_IN_MILLIS,
                DateUtils.FORMAT_ABBREV_RELATIVE));

The timestamp1 and timestamp2 show the same mReferenceTime and on Api23 time is correct but on the Galaxy Tab 3 using Android 4.4.2 time is one hour behind.
There´s is something obvious I have missed!
Must google this for an answer.. what you think?

from android-ago.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.