Created
October 23, 2013 19:03
-
-
Save anataliocs/7124611 to your computer and use it in GitHub Desktop.
Java dates
date conversion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment