R/guide.datetime.R

Defines functions guide.datetime

Documented in guide.datetime

#' Sabali Guide: Datetime
#'
#' This function activates the Sabali Help Guide for Datetime
#' @param activate Do you need help? Defaults to TRUE.
#' @keywords help
#' @export
#' @examples
#' guide.datetime()

guide.datetime <- function(activate = TRUE){
if(activate == TRUE){

guide.datetime <- data.frame("Description" = c("Year (4 Digits)", "Year (2 Digits)",  "Month (Full)", "Month (Abbreviated)", "Month (Decimal)", "Week of Year (Start=Sunday)", "Week of Year (Start=Monday)", "Day of Year (Decimal)", "Day of Month (Decimal)", "Weekday (Full)", "Weekday (Abbreviated)", "Weekday (0=Sunday)", "Hours (24 Hrs)", "Hours (12 Hrs)", "Minutes", "Seconds", "Locale-Specific Date & Time", "Locale-Specific Date", "Locale-Specific Time", "Locale-Specific AM/PM", "Offset from GMT", "Time Zone"), "Code" = c("%Y", "%y", "%B", "%b OR %h", "%m", "%U", "%W", "%j", "%d", "%A", "%a", "%w", "%H", "%I", "%M", "%S", "%c", "%x", "%X", "%p", "%z", "%Z"))

print(guide.datetime)

print("Years Example (%Y-%y)")
print(format(Sys.time(), "%Y-%y"))

print("Months Example (%B-%b-%h-%m)")
print(format(Sys.time(), "%B-%b-%h-%m"))

print("Weeks Example (%U-%W)")
print(format(Sys.time(), "%U-%W"))

print("Days Example (%j-%d)")
print(format(Sys.time(), "%j-%d"))

print("Weekdays Example (%A-%a-%w)")
print(format(Sys.time(), "%A-%a-%w"))

print("Time Example (%H-%I-%M-%S)")
print(format(Sys.time(), "%H-%I-%M-%S"))

} else {

print("Cannot Access Guide")

}
}
sabalicodev/sabali documentation built on Jan. 13, 2020, 2:22 p.m.