Problem with NSTimestamp

"koteswararao mogili" <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel,gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
Hi,

I have got a strange problem with NSTimestamp . When year is 1900 , the hour 
is getting reduced by 1 after parsing with SimpleDateFormat. The problem is 
not observed with Calendar.

Please find the code below.

Any suggestion or help is greatly appreciated..

--Rao



import java.text.*;

import com.webobjects.foundation.*;

import java.util.*;

public class DateTest {

public static void main( String args[]) {

NSTimeZone tz = NSTimeZone.localTimeZone();

NSTimestamp myNSTimestamp = new NSTimestamp(1900, 02,23, 10, 50,47, tz);

/*Calendar rightNow = Calendar.getInstance();

rightNow .set(1900, 02,23, 11, 50,47);*/

SimpleDateFormat tErrorDateFormat = new SimpleDateFormat("HH");

String strTmp = tErrorDateFormat.format(myNSTimestamp);

System.out.println("Hour is ...."+new Integer(strTmp)+" "+myNSTimestamp);

}

}




_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.