Hi,
        If Windows is configured so that it is in the correct timezone then
you can use the following code which should give you the correct string
        Date now = new Date(); // initialise to current UTC Date/Time
        SimpleDateFormat sdf = new SimpleDateFormat( "EEEE yyyy/MM/dd
hh:mm:ss aa zz : zzzzzz" );
        sdf.setTimeZone(TimeZone.getDefault()); // local time
        String dateString = sdf.format(now);

> -----Original Message-----
> From: Javier Tom� [SMTP:[EMAIL PROTECTED]]
> Sent: 31 August 1999 14:01
> To:   [EMAIL PROTECTED]
> Subject:      Problem showing date
>
> Hi, I'm been working in a Servlet that make a page and, in this page I`m
> showing the date of the day using this code:
>
>  DateFormat df = DateFormat.getInstance();
>  String zone = "GMT-4:00";
>  TimeZone tz = TimeZone.getTimeZone("America/La_Paz");
>  df.setTimeZone(tz);
>  java.util.Date date = new java.util.Date();
>
> for printing the date I'm using:
>
> df.format(date)
>
> My problem is this, no matters wich string for "zone" I use, it allways
> displays the same time, and I want the time of my country (VENEZUELA),
> Windows call my Time Zone Caracas/La Paz. Does anybody knows why this code
> is not showing me my time?
>
> Thank you very much...
>
> Javier Tom�

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to