date <- as.POSIXlt("2009-02-10")
update(date, year = 2010, month = 1, mday = 1)
# "2010-01-01 CST"
update(date, year =2010, month = 13, mday = 1)
# "2011-01-01 CST"
update(date, minute = 10, second = 3)
# "2009-02-10 00:10:03 CST"
Run the code above in your browser using DataCamp Workspace