Hello guys, Here i'm again Requesting for your always tremendously appreciated help,
Here's the thing:
I have developed a small desktop application wich gets deployed through JNLP in my organization.
When a User needs to access data that contains dates ( stored as date in MSSQL database) keeps getting a two days before after as response,
but if i query the same field of the same database in other machine I get the correct data.
I have even tried to query the date as a
string and manipulate it that way
thinking that it would fix the problem, but saddly have gotten the same results.
My question is what could be failing? what should I check for?
and why exactly a two days ago date gets returned
Here the key part of the code that involves the query:
"SELECT * FROM TIB_RECEPCION"
try {
Partida= resultado.getString("OR_Partida").toString();
} catch (Exception e) {
}
where or_partida is the date field
which gets the result under the format yyyy-MM-dd
then i need to format it to present it to the user
under the format dd/mm/YYYY
to be sure that the data want to display is the correct i handle it entirely as String or Chars
with this method
public String convertirFechaStringaToDateMostrar(String fecha) {
int longitud=fecha.length();
String FechaMagica=fecha;
String oS="";
String nS="";
char Octavo=0;
char Noveno=0;
for (int i=0;i<longitud;i++)
{
// System.out.println("caracater en la posicion "+i+"es"+FechaMagica.charAt(i));
if(i==8)
Octavo=FechaMagica.charAt(i);
if(i==9)
Noveno=FechaMagica.charAt(i);
}
oS=""+Octavo;
nS=""+Noveno;
String F=oS+nS+"/"+FechaMagica.charAt(5) +FechaMagica.charAt(6) +"/20"+FechaMagica.charAt(2)+FechaMagica.charAt(3);
return F;
}
Again this all seems to be ok, but in some machines I get the two days behind date
Any help comment or suggestion would be deeply apprecated
This is making real noise here in my job...
Thanks!