Get a date associated with a "datum" style object.
This function will return a Date instance found via a property on d according to these rules:
date - assumed to be a Date object already and returned directly
localDate - a string in yyyy-MM-dd form, optionally with a string
localTime property for an associated time in HH:mm form, treated as UTC
created - a string in yyyy-MM-dd HH:mm:ss.SSS'Z' or yyyy-MM-dd'T'HH:mm:ss.SSS'Z' form
These properties are commonly returned in results from the SolarNetwork API, and thus
this method is a handy way to get the dates for those objects.
Note that the localDate and localTime values are parsed as UTC. When formatted the
date for display they should be formatted in UTC as well to preserve the expected value.
Get a date associated with a "datum" style object.
This function will return a
Dateinstance found via a property ondaccording to these rules:date- assumed to be aDateobject already and returned directlylocalDate- a string inyyyy-MM-ddform, optionally with a stringlocalTimeproperty for an associated time inHH:mmform, treated as UTCcreated- a string inyyyy-MM-dd HH:mm:ss.SSS'Z'oryyyy-MM-dd'T'HH:mm:ss.SSS'Z'formThese properties are commonly returned in results from the SolarNetwork API, and thus this method is a handy way to get the dates for those objects.
Note that the
localDateandlocalTimevalues are parsed as UTC. When formatted the date for display they should be formatted in UTC as well to preserve the expected value.