
Search In
Sometime we need two compare two dates like which Date object's time coming first or last.
Here is the code to compare two dates.
Date date1;
Date date2;
if(date1.before(date2)){
System.out.println("Date 1 is before date 2");
On using the javascript technology you can perform the comparison operation very quick in real time.
In this case we will see how to compare two given date:-
var DateOne = "1991-10-10".split('-');
var DateTwo = "2005-09-01".split('-');
var firstDa
In objective C, UIDatePicker is the best way to display date and time options. We can set date of our choice in a Date picker. Also we can set minimum and maximum date.
Here I am creating UIDatePicker first.
UIDatePicker *pickerDate=[[UIDat
Get a date after n days
-(NSDate*)getNextDayAfterDays:(int)numOfDays from:(NSDate*)date
{
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *offsetComponents = [[NSDateComponents a
Number of days between two dates
Here is a code given below for calculating the number of days between a specific date and current date i.e
Hi, iPhone developers today we will see how to fetch records lying between 2 dates in iOS i.e basically applying date filters on records of data. The first thing we have to take care is the "format" of records we have in our database.
In Ca
HI all,
If you want to convert NSString to NSDate ,then you must use NSDateFormatter to convert please follow this code .
NSString to NSDate
In Objective-C :-
NSString *dateString = @"11-11-2015";
NSDateFormatter *dateFormatter = [[NSDateFormatt
Hi if you are using php version 5.3 or greater then some functions are really very quick to write and use.
In this blog I am calculating the days between your given two dates.
This is by far the most accurate way of calculating the difference:
This
In order to parse the String in date, first of all you need to check in which date format the String is coming.
Then we will define date pattern accordingly.
Following steps will guide you how to parse String in Date:-
Step 1
Understand the date for
If you want to calculate the number of days between two dates, you need to make a function,pass the dates and use getTime() function.
Below is the example code :
function GetNoDays(date1, date2) {
var daysIndates = date1.getTime() - date2.get
