1% getDateTimeParts.Rd
2%--------------------------------------------------------------------------
3% What: Extract date and time parts from ... - help
4% $Id$
5% Time-stamp: <2008-12-30 22:44:20 ggorjan>
6%--------------------------------------------------------------------------
7
8\name{getYear}
9
10\alias{getDateTimeParts}
11\alias{getYear}
12\alias{getYear.default}
13\alias{getYear.Date}
14\alias{getYear.POSIXct}
15\alias{getYear.POSIXlt}
16
17\alias{getMonth}
18\alias{getMonth.default}
19\alias{getMonth.Date}
20\alias{getMonth.POSIXct}
21\alias{getMonth.POSIXlt}
22
23\alias{getDay}
24\alias{getDay.default}
25\alias{getDay.Date}
26\alias{getDay.POSIXct}
27\alias{getDay.POSIXlt}
28
29\alias{getHour}
30\alias{getHour.default}
31
32\alias{getMin}
33\alias{getMin.default}
34
35\alias{getSec}
36\alias{getSec.default}
37
38\title{Get date/time parts from date and time objects}
39
40\description{get* functions provide an *experimental* approach for
41  extracting the date/time parts from objects of a date/time class.
42  They are designed to be intiutive and thus lowering the learning
43  curve for work with date and time classes in \R{}.}
44
45\usage{
46
47getYear(x, format, \dots)
48getMonth(x, format, \dots)
49getDay(x, format, \dots)
50getHour(x, format, \dots)
51getMin(x, format, \dots)
52getSec(x, format, \dots)
53
54}
55
56
57\arguments{
58  \item{x}{generic, date/time object}
59  \item{format}{character, format}
60  \item{\dots}{arguments pased to other methods}
61}
62
63\value{Character}
64
65\author{Gregor Gorjanc}
66
67\seealso{
68  \code{\link{Date}},
69  \code{\link{DateTimeClasses}},
70  \code{\link{strptime}}
71}
72
73\examples{
74
75## --- Date class ---
76
77tmp <- Sys.Date()
78tmp
79
80getYear(tmp)
81getMonth(tmp)
82getDay(tmp)
83
84## --- POSIXct class ---
85
86tmp <- as.POSIXct(tmp)
87
88getYear(tmp)
89getMonth(tmp)
90getDay(tmp)
91
92## --- POSIXlt class ---
93
94tmp <- as.POSIXlt(tmp)
95
96getYear(tmp)
97getMonth(tmp)
98getDay(tmp)
99
100}
101
102\keyword{manip}
103\keyword{misc}
104
105%--------------------------------------------------------------------------
106% getDateTimeParts.Rd ends here