Android Open Source - Android-ListView-ContentProvider Date Helper






From Project

Back to project page Android-ListView-ContentProvider.

License

The source code is released under:

MIT License

If you think the Android project Android-ListView-ContentProvider listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.iop.listprovider.helpers;
//from   w  ww  .  j  a  v a 2s .c  o m
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * Created by Rafael Iop
 *
 * Classe utilizada para manipular as datas
 *
 * Calculadora para testar/converter datas para milisegundos:
 * http://www.ruddwire.com/handy-code/date-to-millisecond-calculators
 */

public class DateHelper {

    // Retorna a data atual em ms (milisegundos)
    // Utilizado para salvar o horrio em que a nota foi criada no banco de dados
    public long getHorarioAgora(){
        Calendar cal = Calendar.getInstance();
        return cal.getTimeInMillis();
    }

    // Converte uma data em ms para string
    public String toString(long data){
        SimpleDateFormat ft = new SimpleDateFormat ("HH:mm");
        Date date = new Date(data);

        return ft.format(date);
    }
}




Java Source Code List

com.iop.listprovider.MainActivity.java
com.iop.listprovider.NotaActivity.java
com.iop.listprovider.NotaLVAdapter.java
com.iop.listprovider.helpers.DBHelper.java
com.iop.listprovider.helpers.DateHelper.java
com.iop.listprovider.helpers.UIHelper.java
com.iop.listprovider.model.NotaCP.java
com.iop.listprovider.model.Nota.java