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:
Tim Cooke
Campbell Ritchie
Ron McLeod
Junilu Lacar
Liutauras Vilda
Sheriffs:
Paul Clapham
Jeanne Boyarsky
Henry Wong
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Piet Souris
Carey Brown
Bartenders:
Jesse Duncan
Frits Walraven
Mikalai Zaikin
Forum:
Java in General
Current Date time
Ajay Tickle
Greenhorn
Posts: 17
posted 14 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 14 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
Don't get me started about those stupid
light bulbs
.
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...