Java SQL Date Create getLongDate(String strDate)

Here you can find the source of getLongDate(String strDate)

Description

get Long Date

License

Open Source License

Declaration

public static Long getLongDate(String strDate) 

Method Source Code

//package com.java2s;
/**//from   www  .  j a  va2  s .  c om
 * $RCSfile: DateUtil.java
 * $Revision: 1.0
 * $Date: Jan 30, 2011
 *
 * Copyright (C) 2010 SlFile, Inc. All rights reserved.
 *
 * This software is the proprietary information of SlFile, Inc.
 * Use is subject to license terms.
 */

import java.util.Date;

public class Main {
    public static Long getLongDate(String strDate) {
        Date date = java.sql.Date.valueOf(strDate);
        Long lDate = new Long(date.getTime());
        return (lDate);
    }

    public static Long getLongDate(String strDate, int iType) {
        Long retDate = null;
        switch (iType) {
        case 0:
            retDate = getLongDate(strDate);
            break;
        case 1:
            retDate = new Long(java.sql.Timestamp.valueOf(strDate).getTime());
            break;
        }
        return retDate;
    }
}

Related

  1. getLastDay(java.util.Date dt)
  2. getLastDayofMonth(Date date1)
  3. getLastDayOfMonth(java.sql.Date date)
  4. getLastDayOfPreviousMonth(Date date, boolean isFormatDate)
  5. getLastSundayDate()
  6. getSqlCurrentDate()
  7. getSqlCurrentDate()
  8. getSqlDate()
  9. getSQLDate()