package com.jxhaina.warehouse.util;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;
public class GetDate {
public GetDate(){
}
public static Date getNowDate()
{
Date currentTime = new Date();
return currentTime;
}
public static void main(String arg[]){
System.out.println(strToBirthday("2003-12-01"));
}
public static String getStringDate()
{
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(currentTime);
return dateString;
}
public static String getStringDateShort()
{
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String dateString = formatter.format(currentTime);
return dateString;
}
public static String getDateString(){
SimpleDateFormat simpledateformat = new SimpleDateFormat("yyMdHms");
String strTime = simpledateformat.format(new Date());
return strTime;
}
public static String dateToStrl(Date dateDate){
SimpleDateFormat simpledateformat = new SimpleDateFormat("yyMdHms");
String strTime = simpledateformat.format(dateDate);
return strTime;
}
public static Date strToDate(String strDate)
{
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate;
}
public static String dateToStr(Date dateDate)
{
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(dateDate);
return dateString;
}
public static String dateToStrSh(Date dateDate)
{
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String dateString = formatter.format(dateDate);
return dateString;
}
public static Date strToBirthday(String strDate)
{
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate;
}
public static Date getNow()
{
Date currentTime = new Date();
return currentTime;
}
public static long getS(String strDate)
{
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate.getTime();
}
public static Date getLastDate(long day)
{
Date date = new Date();
long date_3_hm = date.getTime() - 0x74bad00L * day;
Date date_3_hm_date = new Date(date_3_hm);
return date_3_hm_date;
}
public static int getNowDay(String StrDate)
{
Date Time1 = strToDate(StrDate);
Date Time2 = new Date();
long day = Time1.getTime() - Time2.getTime();
return (int)day / 0x5265c00;
}
public static int getNowDay(Date StrDate)
{
Date Time1 = StrDate;
Date Time2 = new Date();
long day = Time1.getTime() - Time2.getTime();
return (int)day / 0x5265c00;
}
}
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;
public class GetDate {
public GetDate(){
}
public static Date getNowDate()
{
Date currentTime = new Date();
return currentTime;
}
public static void main(String arg[]){
System.out.println(strToBirthday("2003-12-01"));
}
public static String getStringDate()
{
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(currentTime);
return dateString;
}
public static String getStringDateShort()
{
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String dateString = formatter.format(currentTime);
return dateString;
}
public static String getDateString(){
SimpleDateFormat simpledateformat = new SimpleDateFormat("yyMdHms");
String strTime = simpledateformat.format(new Date());
return strTime;
}
public static String dateToStrl(Date dateDate){
SimpleDateFormat simpledateformat = new SimpleDateFormat("yyMdHms");
String strTime = simpledateformat.format(dateDate);
return strTime;
}
public static Date strToDate(String strDate)
{
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate;
}
public static String dateToStr(Date dateDate)
{
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(dateDate);
return dateString;
}
public static String dateToStrSh(Date dateDate)
{
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String dateString = formatter.format(dateDate);
return dateString;
}
public static Date strToBirthday(String strDate)
{
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate;
}
public static Date getNow()
{
Date currentTime = new Date();
return currentTime;
}
public static long getS(String strDate)
{
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate.getTime();
}
public static Date getLastDate(long day)
{
Date date = new Date();
long date_3_hm = date.getTime() - 0x74bad00L * day;
Date date_3_hm_date = new Date(date_3_hm);
return date_3_hm_date;
}
public static int getNowDay(String StrDate)
{
Date Time1 = strToDate(StrDate);
Date Time2 = new Date();
long day = Time1.getTime() - Time2.getTime();
return (int)day / 0x5265c00;
}
public static int getNowDay(Date StrDate)
{
Date Time1 = StrDate;
Date Time2 = new Date();
long day = Time1.getTime() - Time2.getTime();
return (int)day / 0x5265c00;
}
}