Sntp Client Android Save

Simple SNTP client class for retrieving network time on Android (SNTPClient)

Project README

SNTPClient for Android

Simple SNTP Client class for retrieving network time on Android (SNTPClient)

Copy-Paste

Copy the SNTPClient.java into your project, there you go. It's ready.

Usage

  1. Retrieve the time of a specific time zone.
SNTPClient.getDate(TimeZone.getTimeZone("Asia/Colombo"), new SNTPClient.Listener() {

    @Override
    public void onTimeResponse(String rawDate, Date date, Exception ex) {

    }
});

  1. Current time zone can be passed to retrieve the current time of the device zone.
Calendar.getInstance().getTimeZone();

About more

  • The output time is formatted according to ISO 8601 format.

yyyy-MM-dd'T'HH:mm:ssZ

  • Time server host is Google

time.google.com

Open Source Agenda is not affiliated with "Sntp Client Android" Project. README Source: aslamanver/sntp-client-android
Stars
36
Open Issues
0
Last Commit
1 year ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating