| MzQCDateTime | R Documentation |
An mzQC-formatted date+time in ISO8601 format, as required by the mzQC spec doc.
An mzQC-formatted date+time in ISO8601 format, as required by the mzQC spec doc.
The format is "%Y-%m-%dT%H:%M:%S".
datetimeA correctly formatted date time (use as read-only)
new()Constructor
MzQCDateTime$new(date = as.character(Sys.time()))
dateOptional POSIXct value for initialization of field datetime. Defaults to Sys.time()
set()Sets datetime value
MzQCDateTime$set(date)
dateNew date-time
isValid()Verifies validity of the object
MzQCDateTime$isValid(context = "MzQCDateTime")
contextOptional string describing location in mzQC structure that is used for more informative warning texts.
toJSON()Creates JSON file from this object.
MzQCDateTime$toJSON(...)
...Optional parameters for jsonlite:::asJSON()
fromData()Sets data for this object from plain named lists of R objects
MzQCDateTime$fromData(data, context = "MzQCDateTime")
dataA datastructure of R lists/arrays as obtained by 'jsonlite::fromJSON()'
contextOptional string describing location in mzQC structure that is used for more informative warning texts.
clone()The objects of this class are cloneable with this method.
MzQCDateTime$clone(deep = FALSE)
deepWhether to make a deep clone.
dt1 = MzQCDateTime$new("1900-01-01") ## yields "1900-01-01T00:00:00Z"
dt2 = MzQCDateTime$new(Sys.time())
## test faulty input
## errors with 'character string is not in a standard unambiguous format'
try(MzQCDateTime$new('lala'), silent=TRUE)
## test roundtrip conversion from/to JSON
dt2$fromData(jsonlite::fromJSON(jsonlite::toJSON(dt1)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.