package gr.mybook.mylocalservice;

import java.util.Date;
import java.util.Locale;
import java.text.SimpleDateFormat;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;

public class myLocalService extends Service {
    private final IBinder myBinder = new MyLocalBinder();
    
	@Override
	public IBinder onBind(Intent arg0) {
		return myBinder;
	}
	
    // Method that contains the service work
    public String getDateTime() {
    	   SimpleDateFormat datetime = new SimpleDateFormat("HH:mm:ss dd/MM/yyyy", Locale.UK);
           return (datetime.format(new Date()));
    }

    public class MyLocalBinder extends Binder {
        myLocalService getService() {
        return myLocalService.this;
        }
    }
}
