Back to project page swap.
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.
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; } }