Java Second Get getCronBySecondScheduler(int second)

Here you can find the source of getCronBySecondScheduler(int second)

Description

get Cron By Second Scheduler

License

Open Source License

Declaration

public static String getCronBySecondScheduler(int second) 

Method Source Code

//package com.java2s;

public class Main {

    public static String getCronBySecondScheduler(int second) {
        if (second >= (24 * 60 * 60) || second == 0) {
            return null;
        }/*from w  ww.  j a  v a  2 s.c om*/
        int hh = 0;
        if (second >= 3600) {
            hh = second / 3600;
            second = second - (hh * 3600);
        }
        int mm = second / 60;
        int ss = second % 60;
        return (ss == 0 ? "0" : ("*/" + ss))
                + (mm == 0 ? (ss == 0 ? (hh == 0 ? (" *") : " 0") : (hh == 0 ? " *" : " 0")) : (" */" + mm))
                + (hh == 0 ? " *" : (" */" + hh)) + " * * ?";
    }
}

Related

  1. currentTimeSecond()
  2. currentTimeSeconds()
  3. currentTimeSeconds()
  4. currentTimeSeconds()
  5. getClockSkewInSeconds()
  6. getCurrentMiliseconds()
  7. getCurrentSecondString()
  8. getCurrentSecondZeroFillString()
  9. getCurrentTimeInSeconds()