![]() Configuration See Duration#locale and Duration#numberingSystem accessors.Unit values See the Duration#years, Duration#months, Duration#weeks, Duration#days, Duration#hours, Duration#minutes, Duration#seconds, Duration#milliseconds accessors.Creation To create a Duration, use omMillis, omObject, or omISO.Here is a brief overview of commonly used methods and getters in Duration: They can be used on their own or in conjunction with other Luxon types for example, you can use DateTime#plus to add a Duration object to a DateTime, producing another DateTime. Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. The Intl system may choose not to honor thisĪ Duration object represents a period of time, like "2 months" or "1 day, 1 hour". Override the numberingSystem of this DateTime. ![]() Don't use in combination with because the decimal output will include the padding. This allows you to round up the result if it fits inside the threshold. Whether to round the numbers in the output. ![]() Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds" Use a specific unit or array of units if omitted, or an array, the method will pick the best unit. The style of units, must be "long", "short", or "narrow" The DateTime to use as the basis to which this time is compared. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation. Output: To convert the DateTime to other representations, use the DateTime#toRelative, DateTime#toRelativeCalendar, DateTime#toJSON, DateTime#toISO, DateTime#toHTTP, DateTime#toObject, DateTime#toRFC2822, DateTime#toString, DateTime#toLocaleString, DateTime#toFormat, DateTime#toMillis and DateTime#toJSDate.Transformation: To transform the DateTime into other DateTimes, use DateTime#set, DateTime#reconfigure, DateTime#setZone, DateTime#setLocale, us, DateTime#minus, DateTime#endOf, DateTime#startOf, DateTime#toUTC, and DateTime#toLocal.Configuration See the DateTime#locale and DateTime#numberingSystem accessors.Week calendar: For ISO week calendar attributes, see the DateTime#weekYear, DateTime#weekNumber, and DateTime#weekday accessors.Gregorian calendar and time: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through DateTime#toObject), use the DateTime#year, DateTime#month,ĭateTime#day, DateTime#hour, DateTime#minute, DateTime#second, DateTime#millisecond accessors.To create one from a native JS date, use omJSDate. To create one from a custom string format, use omFormat. To create one from a standard string format, use omISO, omHTTP, and omRFC2822. Creation: To create a DateTime from its components, use one of its factory class methods: DateTime.local, DateTime.utc, and (most flexibly) omObject.Here is a brief overview of the most commonly used functionality it provides: Configuration properties that effect how output strings are formatted, such as locale, numberingSystem, and outputCalendar.Each instance is considered in the context of a specific zone (by default the local system's zone). Each DateTime instance refers to a specific millisecond of the Unix epoch. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them. A DateTime is an immutable data structure representing a specific date and time and accompanying methods.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |