Here you can find the source of dayToMilliSeconds(String day, String timeZone)
Parameter | Description |
---|---|
day | a parameter |
timeZone | a parameter |
Parameter | Description |
---|---|
ParseException | an exception |
public static long dayToMilliSeconds(String day, String timeZone) throws ParseException
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.TimeZone; public class Main { /**//from ww w . j a va2 s . c o m * Convert String of day to epoch time for targeted time zone. * @param day * @param timeZone * @return * @throws ParseException */ public static long dayToMilliSeconds(String day, String timeZone) throws ParseException { SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); simpleDateFormat.setTimeZone(TimeZone.getTimeZone(timeZone)); return simpleDateFormat.parse(day).getTime(); } }