Date

Can anyone let me know how to create a Date(..) instance which can also have AM/PM set in it.

[100 byte] By [Rama.Krishnaa] at [2007-11-27 11:35:38]
# 1

> Can anyone let me know how to create a Date(..)

> instance which can also have AM/PM set in it.

Date d = new Date(); // AM/PM is intrinsic

Or were you looking to parse a date? If so, look at java.text.DateFormat and java.text.SimpleDateFormat.

~

yawmarka at 2007-7-29 17:04:01 > top of Java-index,Java Essentials,Java Programming...
# 2

You are confusing date objects with their formatted string representations:

http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html

BigDaddyLoveHandlesa at 2007-7-29 17:04:01 > top of Java-index,Java Essentials,Java Programming...
# 3

Hah! Passed on turn 3.

~

yawmarka at 2007-7-29 17:04:01 > top of Java-index,Java Essentials,Java Programming...
# 4

> Hah! Passed on turn 3.

>

> ~

Editing doesn't count, you know, my brother from another mother.

BigDaddyLoveHandlesa at 2007-7-29 17:04:01 > top of Java-index,Java Essentials,Java Programming...
# 5

> Editing doesn't count, you know, my brother from another mother.

You can't triple-stamp a double-stamp! You can't triple-stamp a double-stamp! Lloyd! LLOYD! You...

(Wanna hear the most annoying sound in the world?)

~

yawmarka at 2007-7-29 17:04:01 > top of Java-index,Java Essentials,Java Programming...
# 6

Have a look at Calendar class in API

Ramakrishna

passion_for_javaa at 2007-7-29 17:04:01 > top of Java-index,Java Essentials,Java Programming...