I need official pst and ost binary file format specsavers


If the date represented by the array does not exist, moment isValid will return false. All moments are mutable. If you want a clone of a moment, you can do so implicitly or explicitly. If you want to parse or display a moment in UTC, you can use moment.

It is important to note that though the displays differ above, they are both the same moment in time. Any moment created with moment. To switch from UTC to local time, you can use moment utc or moment local. Moment's string parsing functions like moment string and moment. You can check whether the Moment considers the date invalid using moment isValid. You can check the metrics used by isValid using moment parsingFlags , which returns an object. A date created explicitly as invalid, such as moment.

In addition to the above, As of 2. Additionally, if the Moment is parsed in strict mode, these flags must be empty for the Moment to be valid:. Moment's concept of validity became more strict and consistent between 2. In case of multiple wrong units the first one is returned because days validity may depend on month, for example. After a moment object is created, all of the inputs can be accessed with creationData method:.

You can create a moment object specifying only some of the units, and the rest will be defaulted to the current day, month or year, or 0 for hours, minutes, seconds and milliseconds.

You may be familiar with this pattern from its use in jQuery. Calling these methods without parameters acts as a getter, and calling them with a parameter acts as a setter.

For convenience, both singular and plural method names exist as of version 2. Moment date is for the date of the month, and Moment day is for the day of the week. If the value given is from 0 to 6, the resulting date will be within the current Sunday-to-Saturday week.

This is parsed in the moment's current locale. If the locale assigns Monday as the first day of the week, moment. If Sunday is the first day of the week, moment. Because different locales define week of year numbering differently, Moment. The week of the year varies depending on which day is the first day of the week Sunday, Monday, etc , and which week is the first week of the year. For example, in the United States, Sunday is the first day of the week. The week with January 1st in it is the first week of the year.

In France, Monday is the first day of the week, and the week with January 4th is the first week of the year. The output of moment week will depend on the locale for that moment. Because the first day of the first week does not always fall on the first day of the year, sometimes the week-year will differ from the month year. For example, in the US, the week that contains Jan 1 is always the first week.

In the US, weeks also start on Sunday. If Jan 1 was a Monday, Dec 31 would belong to the same week as Jan 1, and thus the same week-year as Jan 1. Dec 30 would have a different week-year than Dec Gets the number of weeks in the current moment's year, according to ISO weeks.

Units are case insensitive, and support plural and short forms: Once you have a Moment , you may want to manipulate it in some way. There are a number of methods to help with this. This allows you to do crazy things like the following. It should be noted that moments are mutable. Calling any of the manipulation methods will change the original moment. If you want to create a copy and manipulate it, you should use moment clone before manipulating the moment. More info on cloning.

This is a pretty robust function for adding time to an existing moment. To add time, pass the key of what time you want to add, and the amount you want to add. If you want to add multiple different keys at the same time, you can pass them in as an object literal. If the day of the month on the original date is greater than the number of days in the final month, the day of the month will change to the last day in the final month.

There are also special considerations to keep in mind when adding time that crosses over daylight saving time. If you are adding years, months, weeks, or days, the original hour will always match the added hour.

If you are adding hours, minutes, seconds, or milliseconds, the assumption is that you want precision to the hour, and will result in a different hour. It has been deprecated in favor of moment add Number, String. Weeks, quarters, and years are converted to days or months, and then rounded to the nearest integer.

This is exactly the same as moment add , only instead of adding time, it subtracts time. It has been deprecated in favor of moment subtract Number, String. Note that in order to make the operations moment. This is the same as moment startOf , only instead of setting to the start of a unit of time, it sets to the end of a unit of time.

This function has been deprecated in 2. Limits the moment to a maximum of another moment value. Sometimes, server clocks are not quite in sync with client clocks.

This ends up displaying humanized strings such as "in a few seconds" rather than "a few seconds ago". You can prevent that with moment max:. Limits the moment to a minimum of another moment value. Sets a flag on the original moment to use local time to display a moment instead of the original moment's time. Sets a flag on the original moment to use UTC to display a moment instead of the original moment's time. Setting the UTC offset by supplying minutes. Note that once you set an offset, it's fixed and won't change on its own i.

If the input is less than 16 and greater than , it will interpret your input as hours instead. The utcOffset function has an optional second parameter which accepts a boolean value indicating whether to keep the existing time of day. Passing false the default will keep the same instant in Universal Time, but the local time will change.

Passing true will keep the same local time, but at the expense of choosing a different point in Universal Time. One use of this feature is if you want to construct a moment with a specific time zone offset using only numeric input values:.

This is the most robust display option. It takes a string of tokens and replaces them with their corresponding values. They display 3 significant digits and the rest is filled with zeros. Because preferred formatting differs based on locale, there are a few tokens that can be used to format a moment based on its locale. There are upper and lower case variations on the same formats. The lowercase version is intended to be the shortened version of its uppercase counterpart.

LTS was added in 2. While these date formats are very similar to LDML date formats, there are a few minor differences regarding day of month, day of year, and day of week. For a breakdown of a few different date formatting tokens across different locales, see this chart of date formatting tokens. As of version 1. Out of the box, moment. In such cases, it may be useful to set moment. A common way of displaying time is handled by moment fromNow. This is sometimes called timeago or relative time. The base strings are customized by the current locale.

The breakdown of which string is displayed for each length of time is outlined in the table below. You may want to display a moment in relation to a time other than now.

In that case, you can use moment from. The first parameter is anything you can pass to moment or an actual Moment. Like moment fromNow , passing true as the second parameter returns value without the suffix. This is useful wherever you need to have a human readable length of time. A common way of displaying time is handled by moment toNow. This is similar to moment. In that case, you can use moment to. Like moment toNow , passing true as the second parameter returns value without the suffix.

Calendar time displays time relative to a given referenceTime defaults to now , but does so slightly differently than moment fromNow. To get the difference in milliseconds, use moment diff like you would use moment from. To get the difference in another unit of measurement, pass that measurement as the second argument.

To get the duration of a difference between two moments, you can pass diff as an argument into moment duration. See the docs on moment duration for more info. The supported measurements are years , months , weeks , days , hours , minutes , and seconds. For ease of development, the singular forms are supported as of 2.

Units of measurement other than milliseconds are available in version 1. By default, moment diff will truncate the result to zero decimal places, returning an integer. If you want a floating point number, pass true as the third argument. If the moment is earlier than the moment you are passing to moment.

It is optimized to ensure that two months with the same date are always a whole number apart. See more discussion on the month and year diffs here. This change to month and year diffs was made in 2. To get a Unix timestamp the number of seconds since the epoch from a Moment , use moment unix. This will return a copy of the Date that the moment uses, so any changes to that Date will not cause moment to change.

If you want to change the moment Date , see moment manipulate or moment set. This is done to provide consistency with the specification for native JavaScript Date. This returns an object containing year, month, day-of-month, hour, minute, seconds, milliseconds.

Returns a machine readable string, that can be evaluated to produce the same moment. Because of the name its also used in node interactive shell to display objects.

This function is mostly intended for debugging, not all cases are handled precisely. If you want to limit the granularity to a unit other than milliseconds, pass the units as the second parameter.

As the second parameter determines the precision, and not just a single value to check, using day will check for year, month and day. Like moment isAfter and moment isSame , any of the units of time that are supported for moment startOf are supported for moment isBefore.

If the code runs fast the initial created moment would be the same as the one created in isBefore to perform the check, so the result would be false.

But if the code runs slower it's possible that the moment created in isBefore is measurably after the one created in moment , so the call would return true. If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter.

When including a second parameter, it will match all units equal or larger. Passing in month will check month and year. Passing in day will check day , month , and year.

Like moment isAfter and moment isBefore , any of the units of time that are supported for moment startOf are supported for moment isSame. Like moment isSame and moment isBefore , any of the units of time that are supported for moment startOf are supported for moment isAfter. Like moment isAfter and moment isSame , any of the units of time that are supported for moment startOf are supported for moment isSameOrBefore:.

Like moment isSame and moment isBefore , any of the units of time that are supported for moment startOf are supported for moment isSameOrAfter:. Check if a moment is between two other moments, optionally looking at unit scale minutes, hours, days, etc.

The match is exclusive. If you want to limit the granularity to a unit other than milliseconds, pass the units as the third parameter. Like moment isSame , moment isBefore , moment isAfter any of the units of time that are supported for moment startOf are supported for moment isBetween.

Year, month, week, day, hour, minute, and second. A [ indicates inclusion of a value. If the inclusivity parameter is used, both indicators must be passed. Note that in the event that the from and to parameters are the same, but the inclusivity parameters are different, false will preside. It doesn't give the right answer after modifying the moment object. Another important piece of validation is to know if the date has been moved by a DST.

For example, in most of the United States:. This is because daylight saving time shifts the time from 2: The resulting time is browser-dependent, either adjusting the time forward or backwards. Use moment isDSTShifted to test for this condition. If you need other locales, you can load them into Moment.

More details on each of the parts of the locale bundle can be found in the customization section. Once you load a locale, it becomes the active locale. To change active locales, simply call moment. This is useful because Moment won't change locales if it doesn't know the one you specify. You may also specify a list of locales, and Moment will use the first one it has localizations for. Moment will also try locale specifier substrings from most-specific to least-specific until it finds a locale it knows.

This is useful when supplying Moment with a locale string pulled from the user's environment, such as window. A global locale configuration can be problematic when passing around moments that may need to be formatted into different locale.

If you call moment locale with no parameters, you get back the locale configuration that would be used for that moment. It works the same was it does in the global locale configuration. Loading locales in NodeJS is super easy. If you want your locale supported, create a pull request to the develop branch with the required locale and unit test files. Loading locales in the browser just requires you to include the locale files. Be sure to specify the charset to prevent encoding issues.

Locale files are defined in UMD style, so they should work seamlessly in all environments. To add your locale to Moment. If you are changing locales frequently, you may want to know what locale is currently being used.

This is as simple as calling moment. It is sometimes useful to get the list of months or weekdays in a locale, for example when populating a dropdown menu. If true, the weekdays will be returned in locale specific order. For instance, in the Arabic locale, Saturday is the first day of the week, thus:. Absent the locale specific parameter, weekdays always have Sunday as index 0, regardless of the local first day of the week.

Some locales make special considerations into account when formatting month names. For example, Dutch formats month abbreviations without a trailing period, but only if it's formatting the month between dashes. The months method supports passing a format in so that the months will be listed in the proper context.

You can access the properties of the currently loaded locale through the moment. It returns the current locale or a locale with the given key:. This locale will populate the dates with very obviously changed data. Pseudo locales can be useful when testing, as they make obvious what data has and has not been localized. Just include the pseudo-locale, and set moment's locale to x-pseudo. Text from Moment will be very easy to spot.

In general, you should create a locale setting with your customizations. You can remove a previously defined locale by passing null as the second argument. The deleted locale will no longer be available for use. Failing that it will default the parent to the global locale.

Any properties specified will be updated, while others will remain the same. This function does not affect moments that already exist. If you need more processing to calculate the name of the month, for example, if there is different grammar for different formats , Locale months can be a function with the following signature. It should always return a month name. Like Locale months , Locale monthsShort can be a callback function as well. Locale weekdaysMin should be an array of two letter weekday abbreviations.

The purpose of these is for things like calendar pickers, thus they should be as small as possible. LT should be the time format, and is also used for moment calendar.

You can eliminate the lowercase l tokens and they will be created automatically by replacing long tokens with the short token variants.

Locale relativeTime should be an object of the replacement strings for moment from. For all others, a single character refers to the singular, and a double character refers to the plural. If a locale requires additional processing for a token, it can set the token as a function with the following signature. The function should return a string. There are upper and lower case variations on the same formats.

The lowercase version is intended to be the shortened version of its uppercase counterpart. LTS was added in 2. While these date formats are very similar to LDML date formats, there are a few minor differences regarding day of month, day of year, and day of week. For a breakdown of a few different date formatting tokens across different locales, see this chart of date formatting tokens. As of version 1. Out of the box, moment. In such cases, it may be useful to set moment. A common way of displaying time is handled by moment fromNow.

This is sometimes called timeago or relative time. The base strings are customized by the current locale. The breakdown of which string is displayed for each length of time is outlined in the table below. You may want to display a moment in relation to a time other than now. In that case, you can use moment from. The first parameter is anything you can pass to moment or an actual Moment. Like moment fromNow , passing true as the second parameter returns value without the suffix.

This is useful wherever you need to have a human readable length of time. A common way of displaying time is handled by moment toNow. This is similar to moment. In that case, you can use moment to. Like moment toNow , passing true as the second parameter returns value without the suffix.

Calendar time displays time relative to a given referenceTime defaults to now , but does so slightly differently than moment fromNow. To get the difference in milliseconds, use moment diff like you would use moment from. To get the difference in another unit of measurement, pass that measurement as the second argument. To get the duration of a difference between two moments, you can pass diff as an argument into moment duration. See the docs on moment duration for more info.

The supported measurements are years , months , weeks , days , hours , minutes , and seconds. For ease of development, the singular forms are supported as of 2. Units of measurement other than milliseconds are available in version 1. By default, moment diff will truncate the result to zero decimal places, returning an integer. If you want a floating point number, pass true as the third argument. If the moment is earlier than the moment you are passing to moment.

It is optimized to ensure that two months with the same date are always a whole number apart. See more discussion on the month and year diffs here. This change to month and year diffs was made in 2. To get a Unix timestamp the number of seconds since the epoch from a Moment , use moment unix. This will return a copy of the Date that the moment uses, so any changes to that Date will not cause moment to change.

If you want to change the moment Date , see moment manipulate or moment set. This is done to provide consistency with the specification for native JavaScript Date. This returns an object containing year, month, day-of-month, hour, minute, seconds, milliseconds. Returns a machine readable string, that can be evaluated to produce the same moment. Because of the name its also used in node interactive shell to display objects.

This function is mostly intended for debugging, not all cases are handled precisely. If you want to limit the granularity to a unit other than milliseconds, pass the units as the second parameter. As the second parameter determines the precision, and not just a single value to check, using day will check for year, month and day.

Like moment isAfter and moment isSame , any of the units of time that are supported for moment startOf are supported for moment isBefore. If the code runs fast the initial created moment would be the same as the one created in isBefore to perform the check, so the result would be false. But if the code runs slower it's possible that the moment created in isBefore is measurably after the one created in moment , so the call would return true.

If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter. When including a second parameter, it will match all units equal or larger. Passing in month will check month and year. Passing in day will check day , month , and year. Like moment isAfter and moment isBefore , any of the units of time that are supported for moment startOf are supported for moment isSame.

Like moment isSame and moment isBefore , any of the units of time that are supported for moment startOf are supported for moment isAfter. Like moment isAfter and moment isSame , any of the units of time that are supported for moment startOf are supported for moment isSameOrBefore:. Like moment isSame and moment isBefore , any of the units of time that are supported for moment startOf are supported for moment isSameOrAfter:. Check if a moment is between two other moments, optionally looking at unit scale minutes, hours, days, etc.

The match is exclusive. If you want to limit the granularity to a unit other than milliseconds, pass the units as the third parameter. Like moment isSame , moment isBefore , moment isAfter any of the units of time that are supported for moment startOf are supported for moment isBetween. Year, month, week, day, hour, minute, and second. A [ indicates inclusion of a value. If the inclusivity parameter is used, both indicators must be passed.

Note that in the event that the from and to parameters are the same, but the inclusivity parameters are different, false will preside. It doesn't give the right answer after modifying the moment object. Another important piece of validation is to know if the date has been moved by a DST. For example, in most of the United States:. This is because daylight saving time shifts the time from 2: The resulting time is browser-dependent, either adjusting the time forward or backwards.

Use moment isDSTShifted to test for this condition. If you need other locales, you can load them into Moment. More details on each of the parts of the locale bundle can be found in the customization section.

Once you load a locale, it becomes the active locale. To change active locales, simply call moment. This is useful because Moment won't change locales if it doesn't know the one you specify. You may also specify a list of locales, and Moment will use the first one it has localizations for. Moment will also try locale specifier substrings from most-specific to least-specific until it finds a locale it knows. This is useful when supplying Moment with a locale string pulled from the user's environment, such as window.

A global locale configuration can be problematic when passing around moments that may need to be formatted into different locale. If you call moment locale with no parameters, you get back the locale configuration that would be used for that moment. It works the same was it does in the global locale configuration.

Loading locales in NodeJS is super easy. If you want your locale supported, create a pull request to the develop branch with the required locale and unit test files.

Loading locales in the browser just requires you to include the locale files. Be sure to specify the charset to prevent encoding issues. Locale files are defined in UMD style, so they should work seamlessly in all environments. To add your locale to Moment. If you are changing locales frequently, you may want to know what locale is currently being used.

This is as simple as calling moment. It is sometimes useful to get the list of months or weekdays in a locale, for example when populating a dropdown menu. If true, the weekdays will be returned in locale specific order. For instance, in the Arabic locale, Saturday is the first day of the week, thus:. Absent the locale specific parameter, weekdays always have Sunday as index 0, regardless of the local first day of the week. Some locales make special considerations into account when formatting month names.

For example, Dutch formats month abbreviations without a trailing period, but only if it's formatting the month between dashes. The months method supports passing a format in so that the months will be listed in the proper context. You can access the properties of the currently loaded locale through the moment. It returns the current locale or a locale with the given key:. This locale will populate the dates with very obviously changed data. Pseudo locales can be useful when testing, as they make obvious what data has and has not been localized.

Just include the pseudo-locale, and set moment's locale to x-pseudo. Text from Moment will be very easy to spot. In general, you should create a locale setting with your customizations. You can remove a previously defined locale by passing null as the second argument.

The deleted locale will no longer be available for use. Failing that it will default the parent to the global locale.

Any properties specified will be updated, while others will remain the same. This function does not affect moments that already exist. If you need more processing to calculate the name of the month, for example, if there is different grammar for different formats , Locale months can be a function with the following signature.

It should always return a month name. Like Locale months , Locale monthsShort can be a callback function as well. Locale weekdaysMin should be an array of two letter weekday abbreviations. The purpose of these is for things like calendar pickers, thus they should be as small as possible. LT should be the time format, and is also used for moment calendar.

You can eliminate the lowercase l tokens and they will be created automatically by replacing long tokens with the short token variants. Locale relativeTime should be an object of the replacement strings for moment from.

For all others, a single character refers to the singular, and a double character refers to the plural. If a locale requires additional processing for a token, it can set the token as a function with the following signature.

The function should return a string. The key argument refers to the replacement key in the Locale relativeTime object. The number argument refers to the number of units for that key.

For m , the number is the number of minutes, etc. The withoutSuffix argument will be true if the token will be displayed without a suffix, and false if it will be displayed with a suffix. The reason for the inverted logic is because the default behavior is to display with the suffix. The isFuture argument was added in version 1. This has been deprecated. Locale isPM should return true if the input string is past 12 noon. This is used in parsing the a A tokens. To configure what strings should be parsed as input, set the meridiemParse property.

Each of the Locale calendar keys can also be a callback function with the scope of the current moment and first argument a moment that depicts now. It should return a formatting string. Previously, only the ordinal was returned. It is a string of the token that is being ordinalized, for example: For more information on ordinal numbers, see Wikipedia.

For example, by default more than 45 seconds is considered a minute, more than 22 hours is considered a day and so on. To change those cutoffs use moment.

Retrieving and setting ss threshold was added in 2. To control the rounding you can use moment. If you want to change the time that Moment sees, you can specify a method that returns the number of milliseconds since the Unix epoch January 1, This will be used when calling moment , and the current date used when tokens are omitted from format.

In general, any method that needs the current time uses this under the hood. Where a moment is defined as single points in time, durations are defined as a length of time.

A duration is conceptually more similar to '2 hours' than to 'between 2 and 4 pm today'. As such, they are not a good solution to converting between units that depend on context.

For example, a year can be defined as days, days, Trying to convert years to days makes no sense without context. It is much better to use moment diff for calculating days or years between two moments than to use Durations. To create a duration, call moment. If you want to create a moment with a unit of measurement other than milliseconds, you can pass the unit of measurement as well.

The same shorthand for moment add and moment subtract works here as well. Much like moment add , you can pass an object of values if you need multiple different units of measurement. NET style time spans.

The following formats are supported. The format is an hour, minute, second string separated by colons like The number of days can be prefixed with a dot separator like so 7. Partial seconds are supported as well To create an invalid duration you can pass NaN for a value of a unit.

Create a clone of a duration. Durations are mutable, just like moment objects, so this lets you get a snapshot, at some point in time. Sometimes, you want all the goodness of moment from but you don't want to have to create two moments, you just want to display a length of time. To get the number of milliseconds in a duration, use moment. If you want the length of the duration in milliseconds, use moment. If you want the length of the duration in seconds, use moment.

As with the other getters for durations, moment. Pay attention that unlike the other getters for duration, weeks are counted as a subset of the days, and are not taken off the days count. You can also use duration with moment diff to get the duration between two moments.

To do so, simply pass the moment diff method into moment duration as follows:. See here for more information about moment diff. As an alternate to Duration asX , you can use Duration as 'x'. All the shorthand keys from moment add apply here as well. As an alternate to Duration x getters, you can use Duration get 'x'. Returns duration in string as specified by ISO standard. You can get or set the locale of a duration using locale The locale will affect the duration's string methods, like humanize.

See the intl section for more information on internationalization generally. Moment exposes some methods which may be useful to people extending the library or writing custom parsers. Many of Moment's functions allow the caller to pass in aliases for unit enums. For example, all of the get s below are equivalent. If you're extending the library, you may want access to Moment's facilities for that in order to better align your functionality with Moment's.

This will not set the userInvalidated parsing flag unless it's one of the properties specified. You need not specify parsing flags recognized by Moment; the Moment will be invalid nonetheless, and the parsing flags will be returned by parsingFlags. If you are more comfortable working with strftime instead of LDML-like parsing tokens, you can use Ben Oakes' plugin moment-strftime.

The repository is located at github. If you are using OLE Automation dates in. Using this plugin allows you to format OA dates into JavaScript dates and vice-versa. More information and detailed docs can be found on GitHub at http: If you need to work with date ranges, you can use Gianni Chiappetta's plugin moment-range.

Documentation can be found on the homepage github. Another range plugin is Isaac Cambron's library Twix. It has many range-related features and excels at formatting ranges readably. Full documentation of all the options and features is here. Or just grab the JS file from here. To obtain the raw numeric values rather than a string, pass the value true as the third argument to the method:. When installed, it will wrap moment and moment will be able to format and parse Jalaali years and months.

Here is a short example:. If you want to work with Hijri calendar then you can use moment-hijri plugin.