R/toOrdinalDate.R

`toOrdinalDate` <-
function(
    date=NULL,
	language="English") {


        ### ENGLISH

		if (toupper(language)=="ENGLISH") {
            if (is.null(date)) tmp.date <- Sys.time() else tmp.date <- as.Date(date)
            return(paste0(format(tmp.date, '%B'), " ", toOrdinal(as.numeric(format(tmp.date, '%d'))), ", ",  format(tmp.date, '%Y')))
        }

        ### OTHER LANGUAGES

} ### END toOrdinalDate

Try the toOrdinal package in your browser

Any scripts or data that you put into this service are public.

toOrdinal documentation built on May 2, 2019, 3:25 a.m.