This returns time EST.
Well, Date.toString()
will, if you're in EST at the moment. It's not part of the data stored within the Date
- that's just an instant in time, with no idea what time zone or calendar system it might have started off in.
Your first two lines would be more simply written as:
Date currentDate = new Date();
You should use a DateFormat
to convert the Date
into a String
. You can specify the time zone you want to use there. Do not start performing any arithmetic on the date yourself to add/remove offsets - that's a sign that you're heading in the wrong direction.