Android Open Source - gcm_sample Date Utils






From Project

Back to project page gcm_sample.

License

The source code is released under:

Apache License

If you think the Android project gcm_sample 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

/*
 * Copyright (C) 2014 Wolfram Rittmeyer//from  w  w w .  j ava2 s . c o m
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.grokkingandroid.sampleapp.samples.util;

import java.util.Date;

public class DateUtils {

  public static String formatDateTime(String formatStr, Date date) {
    if (date == null) {
      return null;
    }
      return android.text.format.DateFormat.format(formatStr, date).toString();
  }
  
  public static String formatDateTimeForIO(Date date) {
      return formatDateTime("yyyy-MM-dd_hh-mm-ss", date);
  }
  
}




Java Source Code List

com.grokkingandroid.sampleapp.samples.BaseConstants.java
com.grokkingandroid.sampleapp.samples.SampleBaseActivity.java
com.grokkingandroid.sampleapp.samples.SampleBaseFragment.java
com.grokkingandroid.sampleapp.samples.about.AboutFragment.java
com.grokkingandroid.sampleapp.samples.description.DescriptionActivity.java
com.grokkingandroid.sampleapp.samples.description.DescriptionDelegate.java
com.grokkingandroid.sampleapp.samples.description.DescriptionFragment.java
com.grokkingandroid.sampleapp.samples.gcm.BaseActivity.java
com.grokkingandroid.sampleapp.samples.gcm.Constants.java
com.grokkingandroid.sampleapp.samples.gcm.DemoBaseFragment.java
com.grokkingandroid.sampleapp.samples.gcm.GCMDemoActivity.java
com.grokkingandroid.sampleapp.samples.gcm.GcmBroadcastReceiver.java
com.grokkingandroid.sampleapp.samples.gcm.GcmDemoFragment.java
com.grokkingandroid.sampleapp.samples.gcm.GcmIntentService.java
com.grokkingandroid.sampleapp.samples.util.DateUtils.java