DOCUMENTATION
  • Software
    • Software
    • SAS Viya
    • Industries
    • Solutions
    • Products
  • Learn
    • Learn
    • Training
    • Certification
    • Academics
    • Books
    • Video Tutorials
  • Support
    • Support
    • Communities
    • Documentation
    • Developers
    • Support & Services
    • User Groups
  • About Us
    • About Us
    • Why SAS?
    • Company
    • Careers
    • Newsroom
    • Events
    • Contact Us
  • Explore
    • Explore
    • Try & Buy
    • Why SAS?
    • Customer Stories
    • Partners
    • Consulting
  • Software
  • SAS Viya
  • Industries
  • Solutions
  • Products
  • Learn
  • Training
  • Certification
  • Academics
  • Books
  • Video Tutorials
  • Support
  • Communities
  • Documentation
  • Developers
  • Support & Services
  • User Groups
  • About Us
  • Why SAS?
  • Company
  • Careers
  • Newsroom
  • Events
  • Contact Us
  • Explore
  • Try & Buy
  • Why SAS?
  • Customer Stories
  • Partners
  • Consulting
  • Contact Us
Sign In

Create Profile

My SAS

Get access to My SAS, trials, communities and more.

SAS Sites

sas.com
Support
Blogs
Communities
Developer
Curiosity
Videos

Documentation

Learn
Brand
PartnerNet
Merchandise
SAS® Help Center
SAS/ETS® 15.2 User's Guide
15.2
|PDF 
Feedback
 
  • General Information
    • What’s New in SAS/ETS 15.2
    • Introduction
    • Shared Concepts in High-Performance Computing
    • Working with Time Series Data
      • Overview
      • Time Series and SAS Data Sets
      • Dating Observations
      • Subsetting Data and Selecting Observations
      • Storing Time Series in a SAS Data Set
      • Time Series Periodicity and Time Intervals
      • Plotting Time Series
      • Calendar and Time Functions
      • Interval Functions INTNX and INTCK
      • Lags, Leads, Differences, and Summations
      • Transforming Time Series
      • Manipulating Time Series Data Sets
      • Time Series Interpolation
      • Reading Time Series Data
    • Date Intervals, Formats, and Functions
    • SAS Macros and Functions
    • Nonlinear Optimization Methods
  • Procedure Reference
  • Data Access Engines
  • Time Series Forecasting System
 

Working with Time Series Data

Calendar and Time Functions

Subsections:
  • Computing Dates from Calendar Variables
  • Computing Calendar Variables from Dates
  • Converting between Date, Datetime, and Time Values
  • Computing Datetime Values
  • Computing Calendar and Time Variables

Calendar and time functions convert calendar and time variables such as YEAR, MONTH, DAY, and HOUR, MINUTE, SECOND into SAS date or datetime values, and vice versa.

The SAS calendar and time functions are DATEJUL, DATEPART, DAY, DHMS, HMS, HOUR, JULDATE, MDY, MINUTE, MONTH, QTR, SECOND, TIMEPART, WEEKDAY, YEAR, and YYQ. For more information about these functions, see SAS Functions and CALL Routines: Reference.

Copyright © SAS Institute Inc. All rights reserved.
Last updated: August 11, 2020
Privacy Statement Terms of Use 
Copyright © SAS Institute Inc. All Rights Reserved