I have some java code that parses a string and creates a Date object. On Linux, everything works fine, but on Windows it continuously starts at 19:00:00 rather than 00:00:00. Here is the code:
if(currTask != null) {
if((m = p0.matcher(currTask)).matches()) {
date = new Date(Long.valueOf(m.group(2)) - Long.valueOf(m.group(1)));
}
else if((m = p.matcher(currTask)).matches()) {
date = new Date(System.currentTimeMillis() - Long.valueOf(m.group(1)));
}
return padded(date.getHours())+":"+padded(date.getMinutes())+":"+padded(date.getSeconds());
}
The returned value is the problem on Windows. Is this some inconsistency with how one of Date's methods works on Windows as opposed to Linux? Thanks for your help.
- Ken