Android Open Source - swap Date Utils






From Project

Back to project page swap.

License

The source code is released under:

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...

If you think the Android project swap 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 org.solazo.utils;
/*from w ww.j  a  v a2  s .  c o m*/
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by Daniel Zhao on 8/17/13.
 */
public class DateUtils {
    private static DateFormat dateFormat;
    private static final String datePatternPHP = "yyyy-MM-dd HH:mm:ss";
    private static Date date;

    public static String getDate() {
        dateFormat = new SimpleDateFormat(datePatternPHP);
        date = new Date();

        return dateFormat.format(date).toString();
    }

    public static boolean isDay() {
        date = new Date();
        if (date.getHours() <= 19 && date.getHours() >= 6) {
            return true;
        }
        return false;
    }

}




Java Source Code List

org.solazo.AboutFragment.java
org.solazo.GuessActivity.java
org.solazo.LocationActivity.java
org.solazo.MainActivity.java
org.solazo.Solazo.java
org.solazo.SubmitActivity.java
org.solazo.TabActivity.java
org.solazo.swap.AboutActivity.java
org.solazo.swap.AppState.java
org.solazo.swap.GuessActivity.java
org.solazo.swap.LocationService.java
org.solazo.swap.MainActivity.java
org.solazo.swap.SubmitActivity.java
org.solazo.utils.AppState.java
org.solazo.utils.DateUtils.java
org.solazo.utils.LocationUtils.java
org.solazo.utils.WeatherConditionsUtils.java