| Author |
Extract date parts from time stamp
|
Meir Yan
Ranch Hand
Joined: Apr 27, 2006
Posts: 597
|
|
Hello all I have this line : String timestamp = String.valueOf(System.currentTimeMillis()); that gives me the current timestamp but now I need to extract from this timestamp the day parts for example if my current timestamp is : 1154852914737 so it will be extracted to nowYear:2006 nowMonth:8 nowDay:6 nowHour:11 nowMinute:30 nowSecond:2 thanks
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Look at the GregorianCalendar class: http://java.sun.com/j2se/1.5.0/docs/api/java/util/GregorianCalendar.html Since this is not a JSP specific question, moving to Java In General Beginner.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
|
|
subject: Extract date parts from time stamp
|
|
|