Time Zone Offset - Date Format question

I'm wondering if any one knows how to display the time zone offset of a date in the following format "[+-]HH:mm." More so... I need the date/time in the ISO 8601 format "yyyy-MM-dd'T'HH:mm:ss[+-]HH:mm", where the last [+-]HH:mm is the hour representation of the offset. Here's some sample code...
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
Calendar rightnow= Calendar.getInstance();
// So if system date/time is February 14, 2002 at 1:15:00 PM EST, this would produce "2002-02-14T13:15:00"
System.out.println("Current Datetime" + sdf1.format rightnow.getTime());
How can I get the timezone offset appended to my output in a [+-]HH:mm format. So, the above date needs to look like "2002-02-14T13:15:00-05:00". I can get the offset in milliseconds by doing the following:
int offset1 = rightnow.get(rightnow.ZONE_OFFSET) + rightnow.get(rightnow.DST_OFFSET);
But how can you get this representation into the [+-]HH:mm format?
thanks in advance,
stophman

Try something like this:import java.text.* ;
import java.util.* ;
static public String formatISO8601(Calendar cal) {
     * create ISO 8601 formatter for Calendar objects
    MessageFormat iso8601 = new MessageFormat("{0,time}{1,number,+00;-00}:{2,number,00}") ;
    // need to shove a date formatter that is cognizant of the
    // calendar's time zone into the message formatter
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss") ;
    df.setTimeZone(cal.getTimeZone()) ;
    iso8601.setFormat(0, df) ;
     * calculate the time zone offset from UTC in hours and minutes at the current time
    long zoneOff = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET) ;
    zoneOff /= 60000L ;  // in minutes
    int zoneHrs = (int) (zoneOff / 60L) ;
    int zoneMins = (int) (zoneOff % 60L) ;
    if (zoneMins < 0) zoneMins = -zoneMins ;
    return (iso8601.format(new Object[] {
                                cal.getTime(),
                                new Integer(zoneHrs),
                                new Integer(zoneMins)
}

Similar Messages

  • Retrieve System Time Zone Offset?

    Hi, I'm doing some GPS emulation and need to retrieve the system Time Zone Offset in (Hour and Minute). For example if Mountain time zone offset hour = -7 and Minute = 00. Is this information possible to get in Labview?
    Thanks.

    Hello QRP,
    Yes, it can be done, but this way is not very elegant. It will get the GMT offset that your PC has as its current setting.
    Use Format Date/TIme String with a format string of "%z". The output is the offset as a STRING formatted HH:MMS
    Break the string apart with Scan From String to get the individual elements, or by using "%t" as the format, get the offset in seconds.
    Rod.
    EDIT: There shouldn't be a smiley in the time format above, It's "HH : MM : SS" but ignore the spaces!

  • How get current time zone offset ?

    Hi,
    I am facing to a problem related getting time zone offset.
    Below code is used for my application :
    NSDate* sourceDate = [NSDate date];
    NSTimeZone* destinationTimeZone = [NSTimeZone systemTimeZone];
    timeZoneOffset = [destinationTimeZone secondsFromGMTForDate:sourceDate] / 3600;
    But sometimes seems that above code is getting work wrong. For example :
    Knoxville, TN : time zone offset should be -5. But my code resulted it as -4.
    http://www.timeanddate.com/worldclock/city.html?n=843
    This web is related my issue. Here is :
    Standard time zone: UTC/GMT -5 hours
    Daylight saving time: +1 hour
    Current time zone offset: UTC/GMT -4 hours
    Actually I don't know how get to "Daylight saving time:".
    Can you correct this issue for me ?
    Please advice.
    Thanks.

    Hi Raiden -
    RaidenMAC wrote:
    Knoxville, TN : time zone offset should be -5. But my code resulted it as -4.
    I think your code is giving you the correct offset for Knoxville on today's date. The offset for Eastern Standard Time (EST) is -5, but Knoxville is currently on Eastern Daylight Time (EDT), which is one hour later than EST. (-5) + 1 => (-4), which is what your code computed.
    Note that [secondsFromGMTForDate:|http://developer.apple.com/library/ios/documentation/Co coa/Reference/Foundation/Classes/NSTimeZoneClass/Reference/Reference.html#//appleref/doc/uid/20000190-CACDIAIC] is correcting for daylight savings time. That's why you need to pass the date to that method. If you pass a "summer" date, the return offset will be one hour more than it will be for a "winter" date (usually early November to mid March). For example, try moving the date forward 60 days like this:
    NSDate *sourceDate = [NSDate dateWithTimeIntervalSinceNow:3600 * 24 * 60];
    NSTimeZone* destinationTimeZone = [NSTimeZone systemTimeZone];
    int timeZoneOffset = [destinationTimeZone secondsFromGMTForDate:sourceDate] / 3600;
    NSLog(@"sourceDate=%@ timeZoneOffset=%d", sourceDate, timeZoneOffset);
    The above should give you the offset for Knoxville on Dec. 7, 2010, which is a winter date.
    Actually I don't know how get to "Daylight saving time:".
    You can test a NSTimeZone object with [isDaylightSavingTimeForDate:|http://developer.apple.com/library/ios/documentat ion/Cocoa/Reference/Foundation/Classes/NSTimeZoneClass/Reference/Reference.html#//appleref/doc/uid/20000190-CHDCJGHE], but you don't need that information when you obtain the offset with secondsFromGMTForDate:.
    - Ray

  • Customising SYSDATE using time-zone offset

    Situation:
    A database instance is configured with multiple schemas with each holding data for a company. A set of Oracle Forms and Reports programs has been developed to run against each of these schemas.
    However, there are few overseas companies phyiscally located in different time zone with respect to the database location.
    Is there a way to "customise" sysdate to generate "adjusted" date/time value using the time zone offset "without changing the programs" (in Forms, Reports and dbms)? Most of the programs use sysdate to populate date-specific fields.
    Please advise.
    Thanks

    Sysdate is sysdate-- it can't be changed on a session-by-session basis. You could write your own sysdate-like function, but that would require code changes. If you are making code changes, and you're on 9i, I would suggest using a TIMESTAMP WITH TIMEZONE data type.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • About My Time Zone in Date & Time Settings?

    My iMac in System Preferences where they have The Date & Time, well My Time Zone can't Determine My Current Location ever since last night when I they had there Security Update, what do I Do? or is Apple have Problems right now?

    it sometimes happens that it cannot determine the location. but it remembers the last location it got, so if you don't move between time zones all the time it doesn't really matter if it can determine your location right now.
    also, make sure you are connected to the internet when attempting to determine the location.

  • SQL Date Format question

    Hello,
    The date format in an Access database is "Date Time" (
    1/8/2008 6:14:34
    AM ). It's a required format for some functions.
    I need to group product orders by date for a simple revenue
    summary page.
    As the time part of the date is different for all orders,
    trying to group
    all orders by one date ( 1/8/2008 for example ) won't work.
    It results in:
    1/8/2008 6:14:34 AM $30.00
    1/8/2008 7:50:23 AM $20.00
    I need it to be:
    1/8/2008 $50.00
    I've tried convert and datetime but am having some kind of
    brain cramp I
    think and can't get it to work.
    The base SQL is:
    SELECT order_Date, Sum(order_Total) as TotalAmt FROM
    OrderDetails
    GROUP BY order_Date
    Usage:
    <% While ((Repeat1__numRows <> 0) AND (NOT
    Recordset1.EOF)) %>
    <td><%= Recordset1("order_Date") %></td>
    <td><%= Recordset1("TotalAmt") %></td>
    Repeat1__index=Repeat1__index+1
    Repeat1__numRows=Repeat1__numRows-1
    Recordset1.MoveNext()
    Wend
    %>
    Any ideas are appreciated.
    Take care,
    Tim
    Take care,
    Tim
    www.bestbabystuffonline.com

    Hi Baxter,
    I will be summing the totals, but I haven't added that yet.
    The date format was the big hurdle.
    I just have to figure out how to format the date back to
    mm/dd/yyy in the
    repeat region on the page now.
    It's coming out of the rs as yyyy/mm/dd
    <%=Recordset1("orderDate")%>
    I'm thinking I'll need to set up a function to format the way
    orderDate
    displays.
    <%=FriendlyDate(Recordset1("orderDate"))%>
    But, time for a break. Thanks again for the ideas.
    Take care,
    Tim
    "Baxter" <baxter(RemoveThe :-)@gtlakes.com> wrote in
    message
    news:[email protected]...
    >I also thought that you were Summing the totals from the
    order that the
    >item
    > was placed at a different time or is the sum the total
    from just one time
    > stamp?
    > SELECT order_Date, Sum(order_Total) as TotalAmt FROM
    OrderDetails
    > GROUP BY order_Date
    >
    > "TC2112" <[email protected]> wrote in message
    > news:[email protected]...
    >> I got it to group and order correctly with this:
    >>
    >> "SELECT FORMAT(order_Date, 'yyyy/mm/dd') AS
    OrderDate FROM
    > cwq_OrderDetails2
    >> GROUP BY FORMAT(order_Date, 'yyyy/mm/dd') ORDER BY
    FORMAT(order_Date,
    >> 'yyyy/mm/dd') DESC"
    >>
    >> All three had to have the same format (there was the
    brain cramp).
    >>
    >> It takes this data:
    >>
    >> 1/8/2008 6:14:34 AM
    >> 1/8/2008 7:50:23 AM
    >> 1/10/2008 8:50 AM
    >> 1/9/2008 9:01 AM
    >>
    >> and shows it in the recordset as:
    >>
    >> 2008/01/10
    >> 2008/01/09
    >> 2008/01/08
    >>
    >>
    >> Which is perfect. It's gouped and ordered
    descending..
    >>
    >> Now all I need to do is change the display format on
    the page to
    > mm/dd/yyyy
    >> here:
    >>
    >>
    >> <%=Recordset1("orderDate")%>
    >>
    >> Thanks again,
    >>
    >> Tim
    >>
    >>
    >> "Baxter" <baxter(RemoveThe :-)@gtlakes.com>
    wrote in message
    >> news:[email protected]...
    >> > Do you have a order_number field in the
    database you could
    >> > GROUP BY order_number
    >> > Dave
    >> > "TC2112" <[email protected]> wrote in
    message
    >> > news:[email protected]...
    >> >> Hi Baxter,
    >> >>
    >> >> That allows for the correct format to be
    displayed, but it's the
    >> >> format
    >> >> in
    >> >> the recordset that needs to be set at just
    the date so it can be
    > grouped.
    >> >>
    >> >> I'm pretty close with this:
    >> >>
    >> >> "SELECT FORMAT(order_Date, 'mm/dd/yyyy') AS
    OrderDate FROM
    >> >> tblOrderDetails
    >> >> ORDER BY FORMAT(order_Date, 'yyyy/mm/dd')
    DESC"
    >> >>
    >> >> It returns
    >> >>
    >> >> 1/10/2008
    >> >> 1/9/2008
    >> >> 1/8/2008
    >> >> 1/8/2008
    >> >> 1/8/2008
    >> >>
    >> >>
    >> >> Now I just need to figure out the GROUP BY
    in the SQL to return this:
    >> >>
    >> >> 1/10/2008
    >> >> 1/9/2008
    >> >> 1/8/2008
    >> >>
    >> >> GROUP BY order_Date doesn't work as
    order_date in the DB contains the
    >> >> minutes.
    >> >> GROUP BY FORMAT(order_Date, 'mm/dd/yyyy')
    throws an error.
    >> >>
    >> >> Thanks for the ideas :-)
    >> >>
    >> >> Tim
    >> >>
    >> >>
    >> >>
    >> >>
    >> >> "Baxter" <baxter(RemoveThe
    :-)@gtlakes.com> wrote in message
    >> >> news:[email protected]...
    >> >> > Try this, open the Bindings panel and
    select the date field in the
    >> >> > recordset
    >> >> > then to the right
    >> >> > of the panel you will see a column
    header called format on the right
    >> > side
    >> >> > of
    >> >> > the panel ( if you cant see it expand
    the panel box) click the
    > dropdown
    >> >> > arrow and pick the date format you
    want to display on the page from
    > the
    >> >> > Date/Time selections.. Hope this helps
    you.
    >> >> > Dave
    >> >> >
    >> >> > "TC2112" <[email protected]>
    wrote in message
    >> >> >
    news:[email protected]...
    >> >> >> Hi Baxter,
    >> >> >>
    >> >> >> I need to keep the current Date
    Time format in the database table
    >> >> >> as
    >> > some
    >> >> >> other functions need the long
    format.
    >> >> >>
    >> >> >> I'm just trying to format to short
    date in the recordset so I can
    >> >> >> group
    >> >> >> by
    >> >> >> it and have any orders, regardless
    of time, group in a single date.
    >> >> >>
    >> >> >> Thanks,
    >> >> >> Tim
    >> >> >>
    >> >> >> "Baxter" <baxter(RemoveThe
    :-)@gtlakes.com> wrote in message
    >> >> >>
    news:[email protected]...
    >> >> >> > In your order_Date field in
    the database design view set the
    > format
    >> > to
    >> >> >> > Short
    >> >> >> > Date Default Value Now()
    >> >> >> > That should work for you.
    >> >> >> > Dave
    >> >> >> > "TC2112"
    <[email protected]> wrote in message
    >> >> >> >
    news:[email protected]...
    >> >> >> >> Hello,
    >> >> >> >>
    >> >> >> >> The date format in an
    Access database is "Date Time" ( 1/8/2008
    >> >> >> >> 6:14:34
    >> >> >> >> AM ). It's a required
    format for some functions.
    >> >> >> >>
    >> >> >> >> I need to group product
    orders by date for a simple revenue
    > summary
    >> >> > page.
    >> >> >> >> As the time part of the
    date is different for all orders, trying
    > to
    >> >> > group
    >> >> >> >> all orders by one date (
    1/8/2008 for example ) won't work.
    >> >> >> >> It results in:
    >> >> >> >>
    >> >> >> >> 1/8/2008 6:14:34 AM
    $30.00
    >> >> >> >> 1/8/2008 7:50:23 AM
    $20.00
    >> >> >> >>
    >> >> >> >> I need it to be:
    >> >> >> >>
    >> >> >> >> 1/8/2008 $50.00
    >> >> >> >>
    >> >> >> >> I've tried convert and
    datetime but am having some kind of brain
    >> > cramp
    >> >> > I
    >> >> >> >> think and can't get it to
    work.
    >> >> >> >>
    >> >> >> >> The base SQL is:
    >> >> >> >>
    >> >> >> >> SELECT order_Date,
    Sum(order_Total) as TotalAmt FROM
    >> >> >> >> OrderDetails
    >> >> >> >> GROUP BY order_Date
    >> >> >> >>
    >> >> >> >> Usage:
    >> >> >> >>
    >> >> >> >> <% While
    ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) %>
    >> >> >> >>
    >> >> >> >> <td><%=
    Recordset1("order_Date") %></td>
    >> >> >> >> <td><%=
    Recordset1("TotalAmt") %></td>
    >> >> >> >>
    >> >> >> >>
    Repeat1__index=Repeat1__index+1
    >> >> >> >>
    Repeat1__numRows=Repeat1__numRows-1
    >> >> >> >> Recordset1.MoveNext()
    >> >> >> >> Wend
    >> >> >> >> %>
    >> >> >> >>
    >> >> >> >>
    >> >> >> >>
    >> >> >> >> Any ideas are
    appreciated.
    >> >> >> >>
    >> >> >> >> Take care,
    >> >> >> >> Tim
    >> >> >> >>
    >> >> >> >>
    >> >> >> >> --
    >> >> >> >> Take care,
    >> >> >> >>
    >> >> >> >> Tim
    >> >> >> >>
    >> >> >> >>
    www.bestbabystuffonline.com
    >> >> >> >>
    >> >> >> >>
    >> >> >> >
    >> >> >> >
    >> >> >>
    >> >> >>
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >
    >> >
    >>
    >>
    >
    >

  • Time zone offset

    Hi all,
    Im trying to extract the number of offset hours (from GMT) for a given datetime out of a 'timestamp with time zone' but with no success.
    I can't use the function TZ_OFFSET because of DST, the offset is changing acording to DST, and im getting a datetime from all year periods.
    select to_timestamp_tz('10/29/2006 01:01:00 gmt', 'mm/dd/yyyy hh24:mi:ss tzr') from dual
    returns : 10/29/2006 1:01:00.000000000 AM +00:00
    select to_char(to_timestamp_tz('10/29/2006 01:01:00 gmt', 'mm/dd/yyyy hh24:mi:ss tzr')) from dual
    returns : 29-OCT-06 01.01.00.000000000 AM GMT
    the hours offset has turned into the timezone string.....
    Any Ideas?
    Thanx,
    Anna

    I am trying to do the same thing.
    I just want to get the hours from GMT of a given time zone, in standard time always, not daylight savings time.
    Is there a way to do this?

  • How to remove time zone offset when we use a number as a relative time variable?

    Hi everyone!
    I've a small doubt in using a number as a relative time. If I change the display properties of a numeric to relative time, it takes default value "5:30 AM", may be because I'd set time zone to Indian time during installation ( India is 5:30 hours ahead of Greenwhich). I want it to take default value "12:00 AM'. Please help me how I do it?
    ( I can also subtract 5:30 hours and get the same. But I want that to have "12:00 AM" by default......?!)
    Thank you all..!
    pavamana

    pavamana_pk wrote:
    Hi everyone!
    I've a small doubt in using a number as a relative time. If I change the display properties of a numeric to relative time, it takes default value "5:30 AM"
    As Ravens already stated, you are using ABSOLUTE time.  Relative time can only be set to display hours, minutes, and/or seconds.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Business One date format question

    Hi,
    Business One formats dates coming out of the database as specified by the user.  But it looks like, when you set a date variable in your program code to the value coming out of the database and you set an edit text value to that variable, Business One doesn't format it.  Am I right?  I have a solution but I just want to make sure that there isn't something I'm missing.  I'm using VB .NET 2005.
    Thanks,
    Mike
    Edited by: Mike Angelastro on Jan 21, 2010 12:44 PM

    Vasu,
    Thanks for your suggestion.  I followed it but it doesn't seem to work.  The format appears to be more consistent with the machine's data format instead of what was specified in the general settings.  Here is my code:
    oDetailForm.DataSources.UserDataSources.Add("dsDueDate", SAPbouiCOM.BoDataType.dt_DATE)
    oEditText.DataBind.SetBound(True, , "dsDueDate")
    If Year(DueDate) > 1901 Then
             oEditText.Value = DueDate  'Format(DueDate, SystemDateFormat)
    Else
             oEditText.Value = "N/A"
    End If
    Is my code correct?
    Thanks again,
    Mike

  • JFileChooser and date format questions

    I have a JFileChooser that currently works - I set the default directory and allow the user to select a file or enter a file name.
    I have been asked to modify this to prepopulate the file name field on the JFileChooser.
    How do I do that? It is not obvious which method to call to set the filename field.
    Also, the file name needs to be a timestamp "*yyyyMMddHHmmss*.dat"
    I tried creating the timestamp part with the following code, but it does not format as expected.
            String s = "";
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddddHHmmss");
            try
                java.util.Date now = new java.util.Date();
                java.util.Date dat = dateFormat.parse( now.toString() );
                s = dat.toString();
            }What is wrong with this?
    Thanks.

    I don't do Swing and this is also not the subforum for Swing questions. It has its own subforum.

  • Xquery date formatting question

    We are experiencing strange behavior of some xquery functions. I am wondering we are doing something wrong or that there is a bug in the xquery functions.
    When we execute the following xquery:
    fn:current-dateTime()
    it returns:
    2007-01-30T[b]09:51:24.843+01:00
    and when we execute the below xquery
    fn-bea:dateTime-to-string-with-format("yyyyMMddkkmmssSSS",fn:current-dateTime())
    it returns:
    20070130[b]085053645In this example the shocking part is the underlinded/bold part, ie the hour of the day. When we use the first query it returns the correct time and when we use the xquery to also format the current-dateTime it returns the current time minus one hour.
    Does anyone have an idea whether we are doing something wrong?

    You should use getDate() to retrieve your date value from the ResultSet as a java.sql.Date object.
    Then use a SimpleDateFormat in the JSP to format your date.

  • Yet another string to date format  question

    I have searched the forums and cannot find the exact answer I am looking for so here goes.
    SimpleDateFormat sdf = new SimpleDateFormat("M/d/y");
    String strDate = "02/25/04";
    Date myDate = sdf.parse(strDate);
    gives me : Wed Feb 25 00:00:00 EST 2004
    but I need the output of myDate to stay 02/25/04 in order to add the date object to a sql query.
    strDate will come from request.getParameter variable.
    Any help would be greatly appreciated.

    >
    This will only work if I return the value as a string,
    which puts me back right where I started. I simply
    cannot get the formatted value Wed Feb 25 00:00:00 EST
    2004 to return as a Date object 02/25/04. Is this
    possible? When using SQL, as stated above use a PreparedStatement.
    Use the setDate/setTimestamp/setTime methods to put it into the database.
    Use getDate/getTimestamp/getTime to get it out.
    The 'Date' classes do NOT store anything as "02/25/04". They store milliseconds since the epoch in UMT (Universal Mean Time = Greenwich Mean Time.) That is all they store.
    When you display a 'Date' instance it is converted to a display format. You can use SimpleDateFormat to create any display format that you want.

  • How to remove time zone from date time column?

    Hello all,
    I have one birthday calendar list where I am showing birthdays of employees in acompany.
    Now when I display Date in a page I am getting the below output:
    Fri Sep 19 2014 00:00:00 GMT-0700 (Pacific Standard Time)
    Here I just want the below thing as an output:
    Fri Sep 19 2014
    the other things like 00:00:00 GMT-0700 (Pacific Standard Time)
    How should I achieve it?
    Thanks in Advance.

    Hi
    you should use XSLT datetime formatting
    http://amavs.wordpress.com/tag/formatdatetime/
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • Time Capsule Died, Data Recovery Question

    Hello, I have either the 1st or 2nd generation Time Capsule which just recently died.  Since this is my backup drive, I will need to get the data out of this.  The tech specs say its a serial-ATA server grade Hard Drive.   What kind of case do I need to remove the drive from the capsule and put it into a case so that I can successfully transfer data?
    Would a 3.5 SATA case work?   Is it something else?   I've read about the repairs on these things, but am not interesting in soddering.
    Much help would be appreciated.

    Just go into a big computer shop or order it from ebay.. you just need the usb to sata cable and a power supply.. they sell it in a box for about $10. You only need it in a case holder if you intend to keep it that way.
    There are neat desk docking units you can buy where you drop the hard drive in the slot. A bit more than the bare cable.. easy peasy though.
    http://www.ebay.com.au/itm/USB-2-5-3-5-SATA-IDE-Dual-HDD-Hard-Disk-Drive-Dock-Do cking-Station-HUB-Reader-/170926246068?pt=LH_DefaultDomain_15&hash=item27cbff88b 4&_uhb=1
    Just type usb sata dock or holder or cradle into ebay.. and about 20,000 options will leap up at you.
    The drive in the TC is 3.5" standard sata. Don't take the server drive too seriously.. that is the one and only 500GB seagate in the original Gen1.
    To fix the TC you do not need to solder in parts yourself.. there is a list of people who can help you.
    https://sites.google.com/site/lapastenague/a-deconstruction-of-routers-and-modem s/apple-time-capsule-repairers
    And kits available.. https://sites.google.com/site/lapastenague/time-capsule-power-supply-repair-kits
    The units are a drop in replacement.. but change the TC from AC powered to DC powered.

  • Data format question

    I am using the following code to convert today to a string.
    java.util.Date today = new java.util.Date();
         String currDate;
         Locale currentLocale =new Locale("en","US");
         DateFormat dateFormatter = DateFormat.getDateInstance(DateFormat.SHORT, currentLocale);
    currDate = dateFormatter.format(today);
         System.out.println(" --     the sys date = " + currDate);
    It gives me 6/25/03. But what I need is 06/25/2003. Does anyone know how I can get 06/25/2003 format?
    Thanks,
    aloe9451

    >
    java.util.Date today = new java.util.Date();
         String currDate;
         Locale currentLocale =new Locale("en","US");
    DateFormat dateFormatter =
    er = DateFormat.getDateInstance(DateFormat.SHORT,
    currentLocale);Instead of DateFormat use SimpleDateFormat , i mean ..
    "SimpleDateFormat in the package java.text.*;" ..
    you can pass a pattern in this way..
    SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
    currDate = formatter.format(today)
    try .. the System.out. of currDate ... and then you'll see what you wanted
    Sorry my english!!

Maybe you are looking for