Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat are the advantages and disadvantages of using SimpleDateFomat vs JodaTime?
    primarykey
    data
    text
    <p>I am creating a button in Android, minSdkVersion="8" and targetSdkVersion="17", for the user to select the date and time. With a onClick (selectDate) method as follows:</p> <pre><code>public void selectDate(View view) { DialogFragment newFragment = new DatePickerFragment(); newFragment.show(getSupportFragmentManager(), "DatePicker"); } public static void populateSetDate(int year, int month, int day) { m_selectDateBtn.setText(month + "/" + day + "/" + year); } public static class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { return new DatePickerDialog(getActivity(), this, m_year, m_month, m_day); } public void onDateSet(DatePicker view, int year, int month, int day) { populateSetDate(year, month, day); } } </code></pre> <p>After looking at a few other questions on stackoverflow of how to parse the date text that will be stored in the button:</p> <p><a href="https://stackoverflow.com/questions/3941357/string-to-date-time-object-in-android">String to Date/Time object in Android</a></p> <p><a href="https://stackoverflow.com/questions/424522/how-can-i-recognize-the-zulu-time-zone-in-java-dateutils-parsedate">How can I recognize the Zulu time zone in Java DateUtils.parseDate?</a></p> <p><strong>Question:</strong> I am wondering what are the advantages and disadvantages of using SimpleDateFormat vs <a href="http://joda-time.sourceforge.net/" rel="nofollow noreferrer">Joda Time</a>? Or what other Date class would you recommend for what I want to do?</p> <p><a href="http://joda-time.sourceforge.net/" rel="nofollow noreferrer">Joda Time</a> does have some reason why to use Joda Time, but I do not know much about Date classes to know how true the statements are.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload