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. Advertising

  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. Advertising

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:
    315
    Alvin Bruney
    Nov 19, 2003
  2. Russ
    Replies:
    2
    Views:
    288
  3. Fabiano

    Date Formating

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

    Data Grid Date Formating

    JAPHET, Nov 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    463
    Scott Allen
    Nov 3, 2004
  5. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,278
    Michael Borgwardt
    May 30, 2004
Loading...

Share This Page