<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Getting a specific time of day in Oracle</title>
	<atom:link href="http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/</link>
	<description>because I don't believe in life before coffee...</description>
	<lastBuildDate>Wed, 28 Oct 2009 06:44:36 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Deepti</title>
		<link>http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/comment-page-1/#comment-371690</link>
		<dc:creator>Deepti</dc:creator>
		<pubDate>Wed, 14 Jan 2009 10:57:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/#comment-371690</guid>
		<description>It helped me.</description>
		<content:encoded><![CDATA[<p>It helped me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Emmons</title>
		<link>http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/comment-page-1/#comment-97091</link>
		<dc:creator>Jon Emmons</dc:creator>
		<pubDate>Wed, 07 Mar 2007 23:01:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/#comment-97091</guid>
		<description>Rathish,

What you want to use is &#039;D&#039; instead of &#039;day&#039; like in the following example (which was run today, wednesday.)

SQL&gt; select to_char(sysdate, &#039;D&#039;) from dual;

T
-
4

UNIX gurus should be careful since cron starts numbering Sunday as 0 and Oracle starts at 1.</description>
		<content:encoded><![CDATA[<p>Rathish,</p>
<p>What you want to use is &#8216;D&#8217; instead of &#8216;day&#8217; like in the following example (which was run today, wednesday.)</p>
<p>SQL> select to_char(sysdate, &#8216;D&#8217;) from dual;</p>
<p>T<br />
-<br />
4</p>
<p>UNIX gurus should be careful since cron starts numbering Sunday as 0 and Oracle starts at 1.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rathish</title>
		<link>http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/comment-page-1/#comment-96578</link>
		<dc:creator>rathish</dc:creator>
		<pubDate>Wed, 07 Mar 2007 11:56:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/#comment-96578</guid>
		<description>We can get the day as Sunday, Monday etc by using 
SELECT to_char(sysdate,&#039;day&#039;) FROM dual

But is it possible to get the day of date as number? That is Sunday as 1, monday as 2 etc....

pls help.....
Rgds,
Rathish.</description>
		<content:encoded><![CDATA[<p>We can get the day as Sunday, Monday etc by using<br />
SELECT to_char(sysdate,&#8217;day&#8217;) FROM dual</p>
<p>But is it possible to get the day of date as number? That is Sunday as 1, monday as 2 etc&#8230;.</p>
<p>pls help&#8230;..<br />
Rgds,<br />
Rathish.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rajeev</title>
		<link>http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/comment-page-1/#comment-19290</link>
		<dc:creator>rajeev</dc:creator>
		<pubDate>Wed, 20 Dec 2006 16:40:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/#comment-19290</guid>
		<description>If we wanted to truncate time and and add our time like 11:59:00 AM in to date. What should we do?

Pls advise
Thanks
Rajeev</description>
		<content:encoded><![CDATA[<p>If we wanted to truncate time and and add our time like 11:59:00 AM in to date. What should we do?</p>
<p>Pls advise<br />
Thanks<br />
Rajeev</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/comment-page-1/#comment-598</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Fri, 05 May 2006 16:17:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/#comment-598</guid>
		<description>Sandeep, you have a couple things going wrong here.  First, the date you&#039;re working with will need to be converted into the Oracle date format with a TO_DATE first like this:

&lt;code&gt;TO_DATE(&#039;5/5/2006 9:54:33 AM&#039;, &#039;MM/DD/YYYY HH:MI:SS AM&#039;)&lt;/code&gt;

Once you&#039;ve done that you could just use a to_char to view just the month part like this:

&lt;code&gt;SELECT TO_CHAR(TO_DATE(&#039;5/5/2006 9:54:33 AM&#039;, &#039;MM/DD/YYYY HH:MI:SS AM&#039;), &#039;MM/DD/YYYY&#039;) FROM DUAL;

05/05/2006&lt;/code&gt;

Now if you want to do this with the TRUNC function you&#039;ll want to apply it around the TO_DATE function.

&lt;code&gt;SELECT TO_CHAR(TRUNC(TO_DATE(&#039;5/5/2006 9:54:33 AM&#039;, &#039;MM/DD/YYYY HH:MI:SS AM&#039;)), &#039;MM/DD/YYYY HH:MI:SS AM&#039;) from dual;

05/05/2006 12:00:00 AM&lt;/code&gt;

Here we see that the trunc command doesn&#039;t remove the hour/minute/second from the date, but rather it sets them to midnight.

Let me know if this helps.</description>
		<content:encoded><![CDATA[<p>Sandeep, you have a couple things going wrong here.  First, the date you&#8217;re working with will need to be converted into the Oracle date format with a TO_DATE first like this:</p>
<p><code>TO_DATE('5/5/2006 9:54:33 AM', 'MM/DD/YYYY HH:MI:SS AM')</code></p>
<p>Once you&#8217;ve done that you could just use a to_char to view just the month part like this:</p>
<p><code>SELECT TO_CHAR(TO_DATE('5/5/2006 9:54:33 AM', 'MM/DD/YYYY HH:MI:SS AM'), 'MM/DD/YYYY') FROM DUAL;</p>
<p>05/05/2006</code></p>
<p>Now if you want to do this with the TRUNC function you&#8217;ll want to apply it around the TO_DATE function.</p>
<p><code>SELECT TO_CHAR(TRUNC(TO_DATE('5/5/2006 9:54:33 AM', 'MM/DD/YYYY HH:MI:SS AM')), 'MM/DD/YYYY HH:MI:SS AM') from dual;</p>
<p>05/05/2006 12:00:00 AM</code></p>
<p>Here we see that the trunc command doesn&#8217;t remove the hour/minute/second from the date, but rather it sets them to midnight.</p>
<p>Let me know if this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sandeep</title>
		<link>http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/comment-page-1/#comment-594</link>
		<dc:creator>sandeep</dc:creator>
		<pubDate>Fri, 05 May 2006 04:38:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/#comment-594</guid>
		<description>SELECT  TO_CHAR(TRUNC (&#039;5/5/2006  9:54:33 AM&#039;), &#039;MM/DD/YYYY&#039; )  FROM dual ;


I want to truncate date using this command.This is not giving result.Please help me.thanks</description>
		<content:encoded><![CDATA[<p>SELECT  TO_CHAR(TRUNC (&#8217;5/5/2006  9:54:33 AM&#8217;), &#8216;MM/DD/YYYY&#8217; )  FROM dual ;</p>
<p>I want to truncate date using this command.This is not giving result.Please help me.thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Life After Coffee &#187; Scheduling Jobs Using Oracle&#8217;s Job Queue</title>
		<link>http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/comment-page-1/#comment-192</link>
		<dc:creator>Life After Coffee &#187; Scheduling Jobs Using Oracle&#8217;s Job Queue</dc:creator>
		<pubDate>Mon, 13 Feb 2006 16:57:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/2006/02/13/getting-a-specific-time-of-day-in-oracle/#comment-192</guid>
		<description>[...] The best way to assure a job will run at a specific time every day is to truncate the date and add a number of hours to it. I have explained this in greater detail in a separate article Getting a Specific Time of Day in Oracle. [...]</description>
		<content:encoded><![CDATA[<p>[...] The best way to assure a job will run at a specific time every day is to truncate the date and add a number of hours to it. I have explained this in greater detail in a separate article Getting a Specific Time of Day in Oracle. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
