Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static boolean isSameDay(long day1, long day2) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        String str1 = sdf.format(new Date(day1));
        String str2 = sdf.format(new Date(day2));
        if (str1.equals(str2)) {
            return true;
        }
        return false;
    }
}