Java String to Timestamp getTimestamp(String dateValue, String pattern, TimeZone timezone)

Here you can find the source of getTimestamp(String dateValue, String pattern, TimeZone timezone)

Description

get Timestamp

License

Apache License

Declaration

private static long getTimestamp(String dateValue, String pattern,
            TimeZone timezone) throws ParseException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;

import java.util.TimeZone;

public class Main {
    private static long getTimestamp(String dateValue, String pattern,
            TimeZone timezone) throws ParseException {
        DateFormat d = new SimpleDateFormat(pattern);
        Calendar c = Calendar.getInstance(timezone);
        c.setTime(d.parse(dateValue));//w ww  .  ja v a2 s .  c om
        return c.getTimeInMillis();
    }
}

Related

  1. calculateClientRequestId(String timestamp)
  2. getFileNameWithTimeStampInterposed(final String fileName)
  3. getStringToTimestamp(String string)
  4. getTimeStamp(String date)
  5. getTimeStamp(String dateTime)
  6. getTimestamp(String pattern)
  7. getTimeStamp(String pattern, String strDate)
  8. getTimeStamp(String style, Date date)
  9. getTimestamp(String timeStampStr, String logRundateIdStr)