\n",
79 | " \n",
80 | " Object Type | \n",
81 | " Description | \n",
82 | " SAS Analogs | \n",
83 | "
\n",
84 | " date | \n",
85 | " Stores calendar date(year, month, & day) | \n",
86 | " SAS date value = ' 24Oct16 ' d | \n",
87 | " \n",
88 | " \n",
89 | " time | \n",
90 | " Stores time (hours, minutes, seconds, & microseconds) | \n",
91 | " SAS time value = ' 12:34:56 ' t | \n",
92 | "
\n",
93 | "\n",
94 | " \n",
95 | " datetime | \n",
96 | " Stores date & time together | \n",
97 | " SAS datetime value = ' 14Oct16:12:34:56 ' dt | \n",
98 | "
\n",
99 | " \n",
100 | " timedelta | \n",
101 | " The difference between two datetime values | \n",
102 | " SAS datetime interval functions | \n",
103 | "
\n",
104 | " \n",
105 | " \n",
106 | " tzinfo | \n",
107 | " Hanldes timezone related issues | \n",
108 | " Not generally dealt with | \n",
109 | "
\n",
110 | " \n",
111 | "
"
112 | ]
113 | },
114 | {
115 | "cell_type": "markdown",
116 | "metadata": {},
117 | "source": [
118 | " "
119 | ]
120 | },
121 | {
122 | "cell_type": "markdown",
123 | "metadata": {},
124 | "source": [
125 | " "
126 | ]
127 | },
128 | {
129 | "cell_type": "code",
130 | "execution_count": 1,
131 | "metadata": {
132 | "collapsed": true
133 | },
134 | "outputs": [],
135 | "source": [
136 | "from datetime import date, time, datetime, timedelta\n",
137 | "import numpy as np\n",
138 | "import pandas as pd\n",
139 | "from pandas import Series, DataFrame, Index"
140 | ]
141 | },
142 | {
143 | "cell_type": "markdown",
144 | "metadata": {
145 | "collapsed": true
146 | },
147 | "source": [
148 | "## String Literal Mapped to datetime timestamp"
149 | ]
150 | },
151 | {
152 | "cell_type": "markdown",
153 | "metadata": {},
154 | "source": [
155 | "A timestamp is time value that represents a count of the number of seconds from the start of an epoch. This is similiar to SAS datetime values that represent an off-set from an epoch beginning at midnight. "
156 | ]
157 | },
158 | {
159 | "cell_type": "code",
160 | "execution_count": 2,
161 | "metadata": {
162 | "collapsed": false
163 | },
164 | "outputs": [],
165 | "source": [
166 | "pdt = pd.Timestamp('2016-10-24')"
167 | ]
168 | },
169 | {
170 | "cell_type": "code",
171 | "execution_count": 3,
172 | "metadata": {
173 | "collapsed": false
174 | },
175 | "outputs": [
176 | {
177 | "data": {
178 | "text/plain": [
179 | "pandas.tslib.Timestamp"
180 | ]
181 | },
182 | "execution_count": 3,
183 | "metadata": {},
184 | "output_type": "execute_result"
185 | }
186 | ],
187 | "source": [
188 | "type(pdt)"
189 | ]
190 | },
191 | {
192 | "cell_type": "markdown",
193 | "metadata": {},
194 | "source": [
195 | "## date objects"
196 | ]
197 | },
198 | {
199 | "cell_type": "markdown",
200 | "metadata": {},
201 | "source": [
202 | "The syntax for constructing a date object is:\n",
203 | "\n",
204 | " date(year = yyyy, month = mm, day = dd)\n",
205 | " \n",
206 | " Where: yyyy is an integer ranging from 1 to 9999 by default\n",
207 | " mm is an integer ranging from 1 to 12 inclusive\n",
208 | " dd is an integer ranging from 1 to the number of days in the month of the year\n",
209 | "\n",
210 | "The details for the date object are found