anataliocs
10/23/2013 - 7:03 PM

Java dates date conversion

Java dates date conversion

calendar cal = new GregorianCalendar(TimeZone.getTimeZone("EST5EDT"));
                        String birthDate = (String)report.get("birthDateDay") + " " + (String)report.get("birthDateMonth") + " " + (String)report.get("birthDateYear");
                        SimpleDateFormat sdf = new SimpleDateFormat("dd MM yyyy");
                        ageVal = new Date().getTime() - sdf.parse(birthDate).getTime();                     
                        ageVal /= 31536000000l; // covert milliseconds to years
 
        Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("EST5EDT"));
        SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,  yyyy");
        sdf.setCalendar(cal);
        cal.setTime(date);
 
AND  CONVERT(char(10), Dateadd(second, (req.orderforStamp/1000), '01/01/1970'), 101)  between Dateadd(m,-24,GETDATE()) AND GETDATE()