Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.Date;
import java.util.concurrent.TimeUnit;

public class Main {
    public static int TIME_STEP = 30;

    /**
     * Tis method provides the UNIX-time divided by TIME_STEP in milliseconds
     * 
     * @return   the UNIX-time divided by TIME_STEP in milliseconds
     */
    public static long getUnixTimeDividedByTimeStep() {
        return (new Date().getTime() / TimeUnit.SECONDS.toMillis(TIME_STEP));
    }
}