Linked Questions
10 questions linked to/from How to check if a date Object equals yesterday?
160 votes
8 answers
403k views
Get yesterday's date using Date [duplicate]
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"); ...
22 votes
6 answers
67k views
How can I get yesterday's date without using Calendar in Java and without a timestamp just the date? [duplicate]
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 ...
1 vote
2 answers
3k views
How to check a date (in UTC format) is 48 hours before today date [duplicate]
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 ...
0 votes
4 answers
606 views
Subtract date to get yesterday date [duplicate]
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. ...
7 votes
6 answers
40k views
How to set a Java Date object's value to yesterday? [duplicate]
Possible Duplicate: Get yesterday's date using Date What is an elegant way set to a Java Date object's value to yesterday?
0 votes
2 answers
14k views
how to get yesterday date [duplicate]
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....
-2 votes
3 answers
7k views
get yesterday date from timestamp [duplicate]
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 =...
0 votes
2 answers
5k views
How to get yesterday instance from Calendar? [duplicate]
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'...
0 votes
2 answers
2k views
Read in a txt file separating and storing variables (String , Double and int) for later use
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 ...
-3 votes
3 answers
3k views
How can you check if a given time in milliseconds was yesterday?
Given a time in milliseconds, how can you check if it was yesterday?