14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

110 Types of Data Chapter 6<br />

Date-Time Functions and Formats<br />

Table 6.2 Date-Time Functions (Continued)<br />

Function<br />

As Date(expression)<br />

Date DMY(day, month,<br />

year)<br />

Date MDY(month, day,<br />

year)<br />

Day Of Week(date)<br />

Day Of Year(date)<br />

Day(date)<br />

Format(date,<br />

"format")<br />

Hour(datetime)<br />

In Days(n)<br />

In Hours(n)<br />

In Minutes(n)<br />

Explanation<br />

Formats a number or expression so that it shows as a date in a text<br />

window. For example:<br />

x = As Date(8Dec2000 + inDays(2));<br />

shows as:<br />

10Dec2000<br />

Returns the specified date expressed as the number of seconds since<br />

midnight, 1 January 1904. For example, the second Leap Day of the<br />

second millennium is DateDMY(29,2,2004), which returns<br />

3160857600.<br />

Returns the specified date expressed as the number of seconds since<br />

midnight, 1 January 1904. For example, the second Leap Day of the<br />

second millennium is DateMDY(2,29,2004), which returns<br />

3160857600.<br />

Returns an integer representation for the day of the week of the date<br />

supplied. Weeks are Sunday–Saturday.<br />

Returns an integer representation for the day of the year of the date<br />

supplied.<br />

Returns an integer representation for the day of the month of the date<br />

supplied.<br />

Returns the value in the format specified in the second argument. Most<br />

typically used for formatting datetime values from a number of seconds to<br />

a formatted date. Format choices are those shown in the Column Info<br />

dialog box; also see Table 6.3 “How JMP Interprets Two-Digit Years” on<br />

page 115.<br />

Returns an integer representation for the hour part of the date-time value<br />

supplied.<br />

These functions return the number of seconds per n minutes, hours, days,<br />

weeks, or years. Divide by these function to express an interval in seconds<br />

as an interval in other units.<br />

In Weeks(n)<br />

In Years(n)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!