Thursday, July 28, 2005
Thursday, July 14, 2005
Put Muscion Tracfone Motorola C139
ASCII tables [Java] parses string date "dd-mm-yyyy" and converts it into 3 integers.
This program is explained only ..
public
parseaFechaConvierteEnInt (String date) {
/ / parse the date entered .. eg 01/02/2000
int INDX = date. indexOf ("- ", 0); / / INDX = 1
String dS = date. substring (0, INDX) / / d = "1"
indx2 int = date. IndexOf ("-", INDX +1); / / indx2 = 3
String mS = date. substring (INDX +1, indx2) / / m = "2"
int len \u200b\u200b= date. length () ; / / len = 8
String aS = date. substring (indx2 +1, len); / / a = "2002"
/ / convert strings to integers of
int d = Integer. ValueOf (dS). intValue ();
int m = Integer. ValueOf (mS). intValue ();
int a = Integer. ValueOf (aS). intValue ();}
Wednesday, July 13, 2005
Difference Between Stacked Bob Graduated Bob
[Java] difference in days between two dates
This function calculates the difference in days between two dates. Taking as an example of initial date on January 1, 2000 and end date on January 10, 2000, the result returned by the function will be equal to '9 '.
public
long difDiasEntre2fechas (int Y1,int M1,int D1,int Y2,int M2,int D2){
new java.util. GregorianCalendar (Y1,M1,D1);
java.util.GregorianCalendar date2= new java.util. GregorianCalendar (Y2,M2,D2);
long difms=date2. getTimeInMillis () - date1. getTimeInMillis ();
long difd=difms / ( 1000 * * 60 60 24 * )
DIFD return;