Learn R Programming

WikipediR (version 1.0.0)

wiki_timestamp: Timestamp conversion function

Description

wiki_timestamp converts MediaWiki timestamps to POSIX-compliant timestamps, and vice-versa

Usage

wiki_timestamp(timestamp, to_wiki = FALSE)

Arguments

timestamp
The timestamp(s) you wish to convert, provided as a vector. If the intent is to convert them into MediaWiki timestamps, they must be POSIX-compliant.
to_wiki
Whether the intent is to convert them from POSIX to MediaWiki

Examples

Run this code
#MediaWiki to POSIX
wiki_timestamp(timestamp = 20140101010101, to_wiki = FALSE)
#[1] "2014-01-01 01:01:01"

#POSIX to MediaWiki
wiki_timestamp(timestamp = "2014-01-01 01:01:01", to_wiki = TRUE)
#[1] "20140101010101"

Run the code above in your browser using DataLab