Subversion Repositories SmartDukaan

Rev

Rev 3971 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3971 Rev 3975
Line 33... Line 33...
33
        scheduler = Executors.newSingleThreadScheduledExecutor();
33
        scheduler = Executors.newSingleThreadScheduledExecutor();
34
 
34
 
35
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd HH:MM:ss");
35
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd HH:MM:ss");
36
        SimpleDateFormat sdfYYYYMMDD = new SimpleDateFormat("yyyyMMdd");
36
        SimpleDateFormat sdfYYYYMMDD = new SimpleDateFormat("yyyyMMdd");
37
        long initialDelay = 0;
37
        long initialDelay = 0;
38
        long period = 4 * 60 * 60 * 1000; //in milliseconds
38
        long period = 12 * 60 * 60 * 1000; //12 hours in milliseconds
39
 
39
 
40
        try {
40
        try {
41
            Calendar calendar = Calendar.getInstance();
41
            Calendar calendar = Calendar.getInstance();
42
            calendar.add(Calendar.DATE, 1);
42
            calendar.add(Calendar.DATE, 1);
43
            initialDelay = sdf.parse(sdfYYYYMMDD.format(calendar.getTime()) + " 15:00:00").getTime() - new Date().getTime();
43
            initialDelay = sdf.parse(sdfYYYYMMDD.format(calendar.getTime()) + " 15:00:00").getTime() - new Date().getTime();