File: getDateTimePart.Rd

package info (click to toggle)
gdata 3.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 964 kB
  • sloc: sh: 27; makefile: 15
file content (71 lines) | stat: -rw-r--r-- 1,464 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
\name{getYear}
\alias{getDateTimeParts}
\alias{getYear}
\alias{getYear.default}
\alias{getYear.Date}
\alias{getYear.POSIXct}
\alias{getYear.POSIXlt}
\alias{getMonth}
\alias{getMonth.default}
\alias{getMonth.Date}
\alias{getMonth.POSIXct}
\alias{getMonth.POSIXlt}
\alias{getDay}
\alias{getDay.default}
\alias{getDay.Date}
\alias{getDay.POSIXct}
\alias{getDay.POSIXlt}
\alias{getHour}
\alias{getHour.default}
\alias{getMin}
\alias{getMin.default}
\alias{getSec}
\alias{getSec.default}
\title{Get date/time parts from date and time objects}
\description{
  Experimental approach for
  extracting the date/time parts from objects of a date/time class.
  They are designed to be intiutive and thus lowering the learning
  curve for work with date and time classes in \R{}.}
\usage{
getYear(x, format, \dots)
getMonth(x, format, \dots)
getDay(x, format, \dots)
getHour(x, format, \dots)
getMin(x, format, \dots)
getSec(x, format, \dots)
}
\arguments{
  \item{x}{generic, date/time object}
  \item{format}{character, format}
  \item{\dots}{arguments pased to other methods}
}
\value{Character}
\author{Gregor Gorjanc}
\seealso{
  \code{\link{Date}},
  \code{\link{DateTimeClasses}},
  \code{\link{strptime}}
}
\examples{
## Date
tmp <- Sys.Date()
tmp
getYear(tmp)
getMonth(tmp)
getDay(tmp)

## POSIXct
tmp <- as.POSIXct(tmp)
getYear(tmp)
getMonth(tmp)
getDay(tmp)

## POSIXlt
tmp <- as.POSIXlt(tmp)
getYear(tmp)
getMonth(tmp)
getDay(tmp)
}
\keyword{manip}
\keyword{misc}