Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > formating the date to timestamp

Thread Tools

formating the date to timestamp

Posts: n/a

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?

Reply With Quote
Roedy Green
Posts: n/a
On Wed, 30 Jul 2003 19:52:06 +0200, "[XaToA]"
<(E-Mail Removed)> 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.


Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See for The Java Glossary.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Grid Date Formating JAPHET ASP .Net 1 11-03-2004 01:04 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Date Formating Fabiano ASP .Net 1 01-14-2004 05:28 PM
Formating a Date as it is entered? Russ ASP .Net 2 12-04-2003 06:25 PM
Help on date formating John Carnahan ASP .Net 1 11-19-2003 11:29 PM