Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
Current Date time
Ajay Tickle
Greenhorn
Posts: 17
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
How to get current date and time in format of yyyy-MM-dd HH:mm:ss.S
Thank you
Jesper de Jong
Java Cowboy
Posts: 16084
88
I like...
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You can get the current date and time by making a Date object:
Date now = new Date();
You can format it into the desired representation with java.text.SimpleDateFormat - lookup the API documentation of that class.
Jesper's Blog
-
Pluralsight Author Page
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
how to get a current date and time in java?
Another format check :P
Getting the date
Best practice to use timers to check current time and xml file records
Looping accoridng to time
More...