-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
55 lines (37 loc) · 1.29 KB
/
README.Rmd
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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# speedDate
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
speedDate makes it easy to get date format strings for use with `strftime()`.
## Installation
You can install the released version of speedDate from GitHub with:
``` r
devtools::install_github("gadenbuie/speedDate")
```
## Example
Does formatting a timestamp into a character string always start with a long scroll through `?strftime` to look up the correct format tokens?
Now you can get those tokens faster and move on with your day.
The **speedDate** RStudio addin gives you a date
```
`r strftime(as.POSIXct(1136239445.987654, origin = "1970-01-01"), "%A %B %e, %H:%M:%OS6 %G %z", tz = "MST")`
```
and asks you to write it in text in the desired format. So you enter...
```
On 01.02.2006 at 15:04
```
...and the addin immediately gives you the format you want!
```
"`r speedDate:::guess_format("On 01.02.2006 at 15:04")`"
```
---
Inspired by [go's time parsing](https://golang.org/pkg/time/#Parse).