Linked Questions

160 votes
8 answers
403k views

The following function produces today's date; how can I make it produce only yesterday's date? private String toDate() { DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); ...
AKIWEB's user avatar
  • 19.9k
22 votes
6 answers
67k views

I have wrote a method to get the current date in the format of yyyy-MM-dd and want to be able to also create another method for getting yesterday's date, the day before the current date. All this ...
wheelerlc64's user avatar
1 vote
2 answers
3k views

I tried to convert the new today's date object to UTC. But no luck since new date object is always in local time zone. I have been trying to verify two dates using 'before' method. date1 is in UTC ...
Kishore Paparthi's user avatar
0 votes
4 answers
606 views

I have these codes to get the date today in my server DefaultTableModel dnow = MyDB.DataTable("SELECT date_format(now(),'%m-%d-%Y')"); and these code for the formatting for the date. ...
kelvz's user avatar
  • 87
7 votes
6 answers
40k views

Possible Duplicate: Get yesterday's date using Date What is an elegant way set to a Java Date object's value to yesterday?
prilia's user avatar
  • 1,016
0 votes
2 answers
14k views

I want to get yesterday date or date which is of not today but of the past. I am using this code - Calendar calendarMessage = Calendar.getInstance(); Calendar calendarToday = Calendar....
Mariana's user avatar
  • 31
-2 votes
3 answers
7k views

I've got an object with a field timestamp with type java.sql.Timestamp;. And I need to get objects with yesterday date from a collection. How to get them? I mean I need something like this for(int i =...
lapots's user avatar
  • 13.5k
0 votes
2 answers
5k views

I have an android app who manipulates dates via java.util.Calendar When I want to use today's date, I use : Date today = Calendar.getInstance().getTime(); I want to know how to manipulate yesterday'...
M.garcia's user avatar
0 votes
2 answers
2k views

Beginner java programmer , I am Looking for a way to read in a txt file (output from a till) while manipulating certain data that relates to the shift type, transaction type and cost to give me my ...
user1511032's user avatar
-3 votes
3 answers
3k views

Given a time in milliseconds, how can you check if it was yesterday?
Dr. Bright's user avatar