pedromanuel
25-05-2004, 18:01:06
Hola me gustaria poder utilizar la funcion Time de java, pero no se muy bien como utilizarla.
Esto es lo que viene en la APIS, pero no soy capaz de usarlas:
Time (http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Time.html#Time(long))(long time)
Constructs a Time object using a milliseconds time value.
Time
public Time(long time)
Constructs a Time object using a milliseconds time value.
Parameters:
time - milliseconds since January 1, 1970, 00:00:00 GMT; a negative number is milliseconds before January 1, 1970, 00:00:00 GMT
Lo he intentado de las siguientes formas pero ninguna de ellas me funciona:
1. long tiempo;
long numero=100;
tiempo.Time(numero);
ERROR: Tiempo.java:24: long cannot be dereferenced
fecha.Time(numero);
2. long tiempo;
long numero=100;
tiempo=Time(numero);
ERROR:Tiempo.java:24: cannot resolve symbol
symbol : method Time (long)
location: class Tiempo
fecha=Time(numero);
3. long tiempo,fecha;
long numero=100;
fecha=tiempo.Time(numero);
ERROR:Tiempo.java:25: long cannot be dereferenced
fecha=fecha2.Time(numero);
4.tiempo = new long[10];
long numero=100;
tiempo=Time(numero);
ERROR: Tiempo.java:19: cannot resolve symbol
symbol : variable fecha
location: class Tiempo
fecha = new long[10];
^
Tiempo.java:24: cannot resolve symbol
symbol : variable fecha
location: class Tiempo
fecha=Time(numero);
^
Tiempo.java:24: cannot resolve symbol
symbol : method Time (long)
location: class Tiempo
fecha=Time(numero);
^
3 errors
No se me ocurre como hacerlo.
Muchas Gracias
Esto es lo que viene en la APIS, pero no soy capaz de usarlas:
Time (http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Time.html#Time(long))(long time)
Constructs a Time object using a milliseconds time value.
Time
public Time(long time)
Constructs a Time object using a milliseconds time value.
Parameters:
time - milliseconds since January 1, 1970, 00:00:00 GMT; a negative number is milliseconds before January 1, 1970, 00:00:00 GMT
Lo he intentado de las siguientes formas pero ninguna de ellas me funciona:
1. long tiempo;
long numero=100;
tiempo.Time(numero);
ERROR: Tiempo.java:24: long cannot be dereferenced
fecha.Time(numero);
2. long tiempo;
long numero=100;
tiempo=Time(numero);
ERROR:Tiempo.java:24: cannot resolve symbol
symbol : method Time (long)
location: class Tiempo
fecha=Time(numero);
3. long tiempo,fecha;
long numero=100;
fecha=tiempo.Time(numero);
ERROR:Tiempo.java:25: long cannot be dereferenced
fecha=fecha2.Time(numero);
4.tiempo = new long[10];
long numero=100;
tiempo=Time(numero);
ERROR: Tiempo.java:19: cannot resolve symbol
symbol : variable fecha
location: class Tiempo
fecha = new long[10];
^
Tiempo.java:24: cannot resolve symbol
symbol : variable fecha
location: class Tiempo
fecha=Time(numero);
^
Tiempo.java:24: cannot resolve symbol
symbol : method Time (long)
location: class Tiempo
fecha=Time(numero);
^
3 errors
No se me ocurre como hacerlo.
Muchas Gracias