Android Open Source - EasyVote Date Time Utils






From Project

Back to project page EasyVote.

License

The source code is released under:

Apache License

If you think the Android project EasyVote 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.llanox.mobile.easyvote.data.util;
//from  ww  w.  j  av a  2  s .c o  m


import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class DateTimeUtils {

  public static String FORMAT_DATETIME_FULL="yyyy-MM-dd HH:mm:ss";
  public static String FORMAT_DATETIME_SHORT="yyyy-MM-dd";
  public static String FORMAT_DAY_MONTH_LETTERS="d 'de' MMMM";
  public static String FORMAT_DAY_MONTH_SINCRONIZAR="dd/MM/yy HH:mm a";

  
  public static String changeDateToFormatString(Date fecha,String pattern ){
    DateFormat formato=new SimpleDateFormat(pattern);
    return formato.format(fecha);
  }

  public static int getCurrentDayOfWeek(){
    Calendar calendar = Calendar.getInstance();
    int weekday = calendar.get(Calendar.DAY_OF_WEEK);
    return weekday;
  }
  

  
  public static Date changeStringToDate(String fecha,String pattern ) throws ParseException{
    DateFormat formato=new SimpleDateFormat(pattern);
    return formato.parse(fecha);
  }

  public static String changeMillisToFormat(long milliseconds, String pattern) {
    Date fecha = new Date(milliseconds);
    return changeDateToFormatString(fecha, pattern);
  }
}




Java Source Code List

com.llanox.mobile.easyvote.AnswerQuestionDetailActivity.java
com.llanox.mobile.easyvote.AnswerQuestionDetailFragment.java
com.llanox.mobile.easyvote.AnswerQuestionListActivity.java
com.llanox.mobile.easyvote.AnswerQuestionListFragment.java
com.llanox.mobile.easyvote.AppCredentials.java
com.llanox.mobile.easyvote.AppSessionManager.java
com.llanox.mobile.easyvote.AskQuestion.java
com.llanox.mobile.easyvote.ConstantsEasyVote.java
com.llanox.mobile.easyvote.EntryPointActivity.java
com.llanox.mobile.easyvote.PlusBaseActivity.java
com.llanox.mobile.easyvote.QuestionDetailActivity.java
com.llanox.mobile.easyvote.QuestionDetailFragment.java
com.llanox.mobile.easyvote.QuestionListActivity.java
com.llanox.mobile.easyvote.QuestionListFragment.java
com.llanox.mobile.easyvote.data.DataException.java
com.llanox.mobile.easyvote.data.DataLayerManager.java
com.llanox.mobile.easyvote.data.DataSession.java
com.llanox.mobile.easyvote.data.QuestionData.java
com.llanox.mobile.easyvote.data.UserData.java
com.llanox.mobile.easyvote.data.util.DateTimeUtils.java
com.llanox.mobile.easyvote.model.AnswerQuestion.java
com.llanox.mobile.easyvote.model.Question.java
com.llanox.mobile.easyvote.model.User.java