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.

Chapter 6 Types of Data 111<br />

Date-Time Functions and Formats<br />

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

Function<br />

Long Date(date)<br />

Explanation<br />

Returns a string representation for the specified date. The format is based<br />

on your computer’s regional setting. So for the English (United States)<br />

locale, the date is formatted like "Sunday, February 29, 2004". Even<br />

if you are running JMP in English with a different locale, the locale format<br />

is applied.<br />

MDYHMS(date) Returns a string representation for the date supplied, formatted like "2/<br />

29/2004 00:02:20 AM".<br />

Minute(date-time)<br />

Month(date)<br />

InFormat(string,<br />

"format")<br />

Parse Date(string,<br />

"format")<br />

Second(date-time)<br />

Short Date(date)<br />

Time Of Day(date)<br />

Today()<br />

Week Of Year(date)<br />

Year(date)<br />

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

value supplied.<br />

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

Parses a string of a given format and returns datetime value expressed as if<br />

surrounded by As Date(), returning the date in ddMonyyyy format.<br />

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

value supplied.<br />

Returns a string representation for the date supplied, in the format mm/<br />

dd/yyyy, regardless of locale (for example, "02/29/2004").<br />

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

supplied.<br />

Returns the current date and time expressed as the number of seconds<br />

since midnight, 1 January 1904. No arguments are accepted, but the<br />

parentheses are still needed.<br />

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

supplied. Weeks are Sunday–Saturday. Note that the first Sunday of the<br />

year begins week 2.<br />

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

Examples of Common Date-Time Functions<br />

You can use any function that returns seconds within a function that returns a date-time.<br />

For example, if today is May 19, 2011 and the time is 11:37:52 AM, Today() returns the number of<br />

seconds, and the functions that follow show that number of seconds since the base time in different<br />

date-time formats:<br />

Today()

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

Saved successfully!

Ooh no, something went wrong!