<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>devexp &#187; quartz</title>
	<atom:link href="http://www.devexp.eu/tag/quartz/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.devexp.eu</link>
	<description>DEVelopment EXPerience, shared with the world!</description>
	<lastBuildDate>Fri, 28 Oct 2011 12:07:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Quartz: test a cron expression</title>
		<link>http://www.devexp.eu/2009/08/18/quartz-test-a-cron-expression/</link>
		<comments>http://www.devexp.eu/2009/08/18/quartz-test-a-cron-expression/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 11:25:27 +0000</pubDate>
		<dc:creator>Van de Voorde Toni</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[quartz]]></category>

		<guid isPermaLink="false">http://www.devexp.eu/?p=871</guid>
		<description><![CDATA[Cron expressions in quartz can sometimes be difficult to test, especially when the cron is programmed to trigger after hours or days. Unless you want to wait that time, here is some snippet code you can use to test a &#8230; <a href="http://www.devexp.eu/2009/08/18/quartz-test-a-cron-expression/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><div class="wp-caption alignright" style="width: 131px"><img alt="quartz logo" src="http://www.opensymphony.com/quartz/images/quartzEJS.jpg" title="quartz logo" width="121" height="58" /><p class="wp-caption-text">quartz logo</p></div>Cron expressions in quartz can sometimes be difficult to test, especially when the cron is programmed to trigger after hours or days. Unless you want to wait that time, here is some snippet code you can use to test a cron.</p>
<pre class="brush: java; title: ; notranslate">import java.text.ParseException;
import java.util.Date;

import org.quartz.CronExpression;

public class CronTester {

	public static void main(String[] args) throws ParseException {
		final String expression = &quot;0 0 * * * ?&quot;;
        final CronExpression cronExpression = new CronExpression(expression);

        final Date nextValidDate1 = cronExpression.getNextValidTimeAfter(new Date());
        final Date nextValidDate2 = cronExpression.getNextValidTimeAfter(nextValidDate1);

        System.out.println(nextValidDate1);
        System.out.println(nextValidDate2);

	}
}</pre>
<p>Outputs:</p>
<pre class="brush: plain; title: ; notranslate">Tue Aug 18 14:00:00 CEST 2009
Tue Aug 18 15:00:00 CEST 2009</pre>
<div class="shr-publisher-871"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.devexp.eu/2009/08/18/quartz-test-a-cron-expression/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

