formating the date to timestamp

Discussion in 'Java' started by [XaToA], Jul 30, 2003.

  1. [XaToA]

    [XaToA] Guest

    hello for formating the date in timestamp format i have make this:

    SimpleDateFormat fechabase = new SimpleDateFormat("yy-MM-dd hh:mm:ss.nn");
    String strhoy = fechabase.format(new Date());

    but the format (yy-MM-dd hh:mm:ss.nn) is worng, in the n is the error.
    th timestamp is :
    2003-03-03 00:00:00.0

    how can i make for getting one timestamp format?
    thanks
     
    [XaToA], Jul 30, 2003
    #1
    1. Advertisements

  2. [XaToA]

    Roedy Green Guest

    On Wed, 30 Jul 2003 19:52:06 +0200, "[XaToA]"
    <> wrote or quoted :

    >but the format (yy-MM-dd hh:mm:ss.nn) is worng, in the n is the error.
    >th timestamp is :
    >2003-03-03 00:00:00.0


    there is no such formatting code as n. Try S for millisecond.

    see http://mindprod.com/jgloss/calendar.html

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jul 30, 2003
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Carnahan

    Help on date formating

    John Carnahan, Nov 19, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    399
    Alvin Bruney
    Nov 19, 2003
  2. Russ
    Replies:
    2
    Views:
    373
  3. Fabiano

    Date Formating

    Fabiano, Jan 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    413
    André Almeida Maldonado
    Jan 14, 2004
  4. JAPHET

    Data Grid Date Formating

    JAPHET, Nov 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    539
    Scott Allen
    Nov 3, 2004
  5. Alper OZGUR

    Formating Textbox value as short date...

    Alper OZGUR, Feb 17, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    660
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Feb 17, 2006
  6. =?Utf-8?B?Sm9obiBCYWlsZXk=?=

    Formating a date field in ASP .Net 2.0 detailview

    =?Utf-8?B?Sm9obiBCYWlsZXk=?=, Mar 29, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    3,991
    elizas
    Apr 29, 2010
  7. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,756
    Michael Borgwardt
    May 30, 2004
  8. =?Utf-8?B?YW1qYWQ=?=

    formating date

    =?Utf-8?B?YW1qYWQ=?=, Jun 21, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    452
    Lionel Schiepers
    Jun 21, 2006
Loading...