Zum Hauptinhalt springen
Version: 25.143.1202.1

Date

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:772

Enables basic storage and retrieval of dates and times.

Methoden​

[toPrimitive]()​

Aufrufsignatur​

toPrimitive: string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:116

Converts a Date object to a string.

Parameter​
ParameterType
hint"default"
Rückgabewert​

string

Aufrufsignatur​

toPrimitive: string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:120

Converts a Date object to a string.

Parameter​
ParameterType
hint"string"
Rückgabewert​

string

Aufrufsignatur​

toPrimitive: number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:124

Converts a Date object to a number.

Parameter​
ParameterType
hint"number"
Rückgabewert​

number

Aufrufsignatur​

toPrimitive: string | number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:133

Converts a Date object to a string or number.

Parameter​
ParameterTypeDescription
hintstringThe strings "number", "string", or "default" to specify what primitive to return.
Rückgabewert​

string | number

A number if 'hint' was "number", a string if 'hint' was "string" or "default".

Throws​

If 'hint' was given something other than "number", "string", or "default".


addDays()​

addDays(days): Date;

Definiert in: lib/cosmolink.Lib.DateExtensions.ts:110

Addiert die angebene Anzahl an Tagen zum aktuellen Datum und gibt dieses als Date zurück.

Parameter​

ParameterTypeDescription
daysnumberAnzahl der Tage

Rückgabewert​

Date

Example​

const dat = new Date();
const newDat = dat.addDays(2);

addHours()​

addHours(hours): Date;

Definiert in: lib/cosmolink.Lib.DateExtensions.ts:123

Addiert die angebene Anzahl an Stunden zum aktuellen Datum und gibt dieses als Date zurück.

Parameter​

ParameterTypeDescription
hoursnumberAnzahl der Stunden

Rückgabewert​

Date

Example​

const dat = new Date();
const newDat = dat.addHours(2);

addMilliseconds()​

addMilliseconds(milliseconds): Date;

Definiert in: lib/cosmolink.Lib.DateExtensions.ts:162

Addiert die angebene Anzahl an Millisekunden zum aktuellen Datum und gibt dieses als Date zurück.

Parameter​

ParameterTypeDescription
millisecondsnumberAnzahl der Millisekunden

Rückgabewert​

Date

Example​

const dat = new Date();
const newDat = dat.addMilliseconds(2);

addMinutes()​

addMinutes(minutes): Date;

Definiert in: lib/cosmolink.Lib.DateExtensions.ts:136

Addiert die angebene Anzahl an Minuten zum aktuellen Datum und gibt dieses als Date zurück.

Parameter​

ParameterTypeDescription
minutesnumberAnzahl der Minuten

Rückgabewert​

Date

Example​

const dat = new Date();
const newDat = dat.addMinutes(2);

addMonths()​

addMonths(months): Date;

Definiert in: lib/cosmolink.Lib.DateExtensions.ts:97

Addiert die angebene Anzahl an Monaten zum aktuellen Datum und gibt dieses als Date zurück.

Parameter​

ParameterTypeDescription
monthsnumberAnzahl der Monate

Rückgabewert​

Date

Example​

const dat = new Date();
const newDat = dat.addMonths(2);

addSeconds()​

addSeconds(seconds): Date;

Definiert in: lib/cosmolink.Lib.DateExtensions.ts:149

Addiert die angebene Anzahl an Sekunden zum aktuellen Datum und gibt dieses als Date zurück.

Parameter​

ParameterTypeDescription
secondsnumberAnzahl der Sekunden

Rückgabewert​

Date

Example​

const dat = new Date();
const newDat = dat.addSeconds(2);

addYears()​

addYears(years): Date;

Definiert in: lib/cosmolink.Lib.DateExtensions.ts:84

Addiert die angebene Anzahl an Jahren zum aktuellen Datum und gibt dieses als Date zurück.

Parameter​

ParameterTypeDescription
yearsnumberAnzahl der Jahre

Rückgabewert​

Date

Example​

const dat = new Date();
const newDat = dat.addYears(2);

copy()​

copy(): Date;

Definiert in: lib/cosmolink.Lib.DateExtensions.ts:177

Erstellt eine Kopie des Date.

Rückgabewert​

Date


getDate()​

getDate(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:798

Gets the day-of-the-month, using local time.

Rückgabewert​

number


getDay()​

getDay(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:802

Gets the day of the week, using local time.

Rückgabewert​

number


getDaysInMonth()​

getDaysInMonth(): number;

Definiert in: lib/cosmolink.Lib.DateExtensions.ts:172

Gibt die maximale Anzahl an Tagen des Monats zurück.

Rückgabewert​

number


getFullYear()​

getFullYear(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:790

Gets the year, using local time.

Rückgabewert​

number


getHours()​

getHours(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:806

Gets the hours in a date, using local time.

Rückgabewert​

number


getMilliseconds()​

getMilliseconds(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:818

Gets the milliseconds of a Date, using local time.

Rückgabewert​

number


getMinutes()​

getMinutes(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:810

Gets the minutes of a Date object, using local time.

Rückgabewert​

number


getMonth()​

getMonth(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:794

Gets the month, using local time.

Rückgabewert​

number


getSeconds()​

getSeconds(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:814

Gets the seconds of a Date object, using local time.

Rückgabewert​

number


getTime()​

getTime(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:788

Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC.

Rückgabewert​

number


getTimezoneOffset()​

getTimezoneOffset(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:822

Gets the difference in minutes between Universal Coordinated Time (UTC) and the time on the local computer.

Rückgabewert​

number


getUTCDate()​

getUTCDate(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:800

Gets the day-of-the-month, using Universal Coordinated Time (UTC).

Rückgabewert​

number


getUTCDay()​

getUTCDay(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:804

Gets the day of the week using Universal Coordinated Time (UTC).

Rückgabewert​

number


getUTCFullYear()​

getUTCFullYear(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:792

Gets the year using Universal Coordinated Time (UTC).

Rückgabewert​

number


getUTCHours()​

getUTCHours(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:808

Gets the hours value in a Date object using Universal Coordinated Time (UTC).

Rückgabewert​

number


getUTCMilliseconds()​

getUTCMilliseconds(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:820

Gets the milliseconds of a Date object using Universal Coordinated Time (UTC).

Rückgabewert​

number


getUTCMinutes()​

getUTCMinutes(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:812

Gets the minutes of a Date object using Universal Coordinated Time (UTC).

Rückgabewert​

number


getUTCMonth()​

getUTCMonth(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:796

Gets the month of a Date object using Universal Coordinated Time (UTC).

Rückgabewert​

number


getUTCSeconds()​

getUTCSeconds(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:816

Gets the seconds of a Date object using Universal Coordinated Time (UTC).

Rückgabewert​

number


isLeapYear()​

isLeapYear(): boolean;

Definiert in: lib/cosmolink.Lib.DateExtensions.ts:167

Gibt an, ob es sich um ein Schaltjahr handelt.

Rückgabewert​

boolean


setDate()​

setDate(date): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:885

Sets the numeric day-of-the-month value of the Date object using local time.

Parameter​

ParameterTypeDescription
datenumberA numeric value equal to the day of the month.

Rückgabewert​

number


setFullYear()​

setFullYear(
year,
month?,
date?): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:909

Sets the year of the Date object using local time.

Parameter​

ParameterTypeDescription
yearnumberA numeric value for the year.
month?numberA zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.
date?numberA numeric value equal for the day of the month.

Rückgabewert​

number


setHours()​

setHours(
hours,
min?,
sec?,
ms?): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:872

Sets the hour value in the Date object using local time.

Parameter​

ParameterTypeDescription
hoursnumberA numeric value equal to the hours value.
min?numberA numeric value equal to the minutes value.
sec?numberA numeric value equal to the seconds value.
ms?numberA numeric value equal to the milliseconds value.

Rückgabewert​

number


setMilliseconds()​

setMilliseconds(ms): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:832

Sets the milliseconds value in the Date object using local time.

Parameter​

ParameterTypeDescription
msnumberA numeric value equal to the millisecond value.

Rückgabewert​

number


setMinutes()​

setMinutes(
min,
sec?,
ms?): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:857

Sets the minutes value in the Date object using local time.

Parameter​

ParameterTypeDescription
minnumberA numeric value equal to the minutes value.
sec?numberA numeric value equal to the seconds value.
ms?numberA numeric value equal to the milliseconds value.

Rückgabewert​

number


setMonth()​

setMonth(month, date?): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:896

Sets the month value in the Date object using local time.

Parameter​

ParameterTypeDescription
monthnumberA numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
date?numberA numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.

Rückgabewert​

number


setSeconds()​

setSeconds(sec, ms?): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:844

Sets the seconds value in the Date object using local time.

Parameter​

ParameterTypeDescription
secnumberA numeric value equal to the seconds value.
ms?numberA numeric value equal to the milliseconds value.

Rückgabewert​

number


setTime()​

setTime(time): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:827

Sets the date and time value in the Date object.

Parameter​

ParameterTypeDescription
timenumberA numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.

Rückgabewert​

number


setUTCDate()​

setUTCDate(date): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:890

Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).

Parameter​

ParameterTypeDescription
datenumberA numeric value equal to the day of the month.

Rückgabewert​

number


setUTCFullYear()​

setUTCFullYear(
year,
month?,
date?): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:916

Sets the year value in the Date object using Universal Coordinated Time (UTC).

Parameter​

ParameterTypeDescription
yearnumberA numeric value equal to the year.
month?numberA numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.
date?numberA numeric value equal to the day of the month.

Rückgabewert​

number


setUTCHours()​

setUTCHours(
hours,
min?,
sec?,
ms?): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:880

Sets the hours value in the Date object using Universal Coordinated Time (UTC).

Parameter​

ParameterTypeDescription
hoursnumberA numeric value equal to the hours value.
min?numberA numeric value equal to the minutes value.
sec?numberA numeric value equal to the seconds value.
ms?numberA numeric value equal to the milliseconds value.

Rückgabewert​

number


setUTCMilliseconds()​

setUTCMilliseconds(ms): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:837

Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).

Parameter​

ParameterTypeDescription
msnumberA numeric value equal to the millisecond value.

Rückgabewert​

number


setUTCMinutes()​

setUTCMinutes(
min,
sec?,
ms?): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:864

Sets the minutes value in the Date object using Universal Coordinated Time (UTC).

Parameter​

ParameterTypeDescription
minnumberA numeric value equal to the minutes value.
sec?numberA numeric value equal to the seconds value.
ms?numberA numeric value equal to the milliseconds value.

Rückgabewert​

number


setUTCMonth()​

setUTCMonth(month, date?): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:902

Sets the month value in the Date object using Universal Coordinated Time (UTC).

Parameter​

ParameterTypeDescription
monthnumberA numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
date?numberA numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.

Rückgabewert​

number


setUTCSeconds()​

setUTCSeconds(sec, ms?): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:850

Sets the seconds value in the Date object using Universal Coordinated Time (UTC).

Parameter​

ParameterTypeDescription
secnumberA numeric value equal to the seconds value.
ms?numberA numeric value equal to the milliseconds value.

Rückgabewert​

number


toDateString()​

toDateString(): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:776

Returns a date as a string value.

Rückgabewert​

string


toFormatedString()​

toFormatedString(format, languageCode?): string;

Definiert in: lib/cosmolink.Lib.DateExtensions.ts:59

Erlaubt es ein Date zu formatieren.

y - Jahr

M - Monat

d - Tag

h - Stunden im 12 Stunden Format / H - Stunden im 12 Stunden Format

m - Minuten

s - Sekunden

Parameter​

ParameterTypeDescription
formatstringFormat
languageCode?stringSprache Code Default = DE

Rückgabewert​

string

Example​

const d = new Date(Date.now());
d.toFormatedString("yyyyMMdd HH:mm:ss") //=> 20991231 18:04:33
d.toFormatedString("dd.MM.yyyy HH:mm") //=> 31.09.2023 18:04

toISOString()​

toISOString(): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:920

Returns a date as a string value in ISO format.

Rückgabewert​

string


toJSON()​

toJSON(key?): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:922

Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization.

Parameter​

ParameterType
key?any

Rückgabewert​

string


toLocaleDateString()​

Aufrufsignatur​

toLocaleDateString(): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:782

Returns a date as a string value appropriate to the host environment's current locale.

Rückgabewert​

string

Aufrufsignatur​

toLocaleDateString(locales?, options?): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:4586

Converts a date to a string by using the current or specified locale.

Parameter​
ParameterTypeDescription
locales?string | string[]A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
options?DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Rückgabewert​

string

Aufrufsignatur​

toLocaleDateString(locales?, options?): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es2020.date.d.ts:34

Converts a date to a string by using the current or specified locale.

Parameter​
ParameterTypeDescription
locales?LocalesArgumentA locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
options?DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Rückgabewert​

string


toLocaleString()​

Aufrufsignatur​

toLocaleString(): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:780

Returns a value as a string value appropriate to the host environment's current locale.

Rückgabewert​

string

Aufrufsignatur​

toLocaleString(locales?, options?): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:4580

Converts a date and time to a string by using the current or specified locale.

Parameter​
ParameterTypeDescription
locales?string | string[]A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
options?DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Rückgabewert​

string

Aufrufsignatur​

toLocaleString(locales?, options?): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es2020.date.d.ts:27

Converts a date and time to a string by using the current or specified locale.

Parameter​
ParameterTypeDescription
locales?LocalesArgumentA locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
options?DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Rückgabewert​

string


toLocaleTimeString()​

Aufrufsignatur​

toLocaleTimeString(): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:784

Returns a time as a string value appropriate to the host environment's current locale.

Rückgabewert​

string

Aufrufsignatur​

toLocaleTimeString(locales?, options?): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:4593

Converts a time to a string by using the current or specified locale.

Parameter​
ParameterTypeDescription
locales?string | string[]A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
options?DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Rückgabewert​

string

Aufrufsignatur​

toLocaleTimeString(locales?, options?): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es2020.date.d.ts:41

Converts a time to a string by using the current or specified locale.

Parameter​
ParameterTypeDescription
locales?LocalesArgumentA locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
options?DateTimeFormatOptionsAn object that contains one or more properties that specify comparison options.
Rückgabewert​

string


toSqlString()​

toSqlString(onlyDatePart?): string;

Definiert in: lib/cosmolink.Lib.DateExtensions.ts:71

Formatiert einen Date für Sql.

Parameter​

ParameterTypeDescription
onlyDatePart?booleanGibt nur das Datum ohne Zeit zurück Default = false

Rückgabewert​

string

Example​

const d = new Date(Date.now());
d.toSqlString() //=> '20991231 18:04:33'
d.toSqlString(true) //=> '20991231'

toString()​

toString(): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:774

Returns a string representation of a date. The format of the string depends on the locale.

Rückgabewert​

string


toTimeString()​

toTimeString(): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:778

Returns a time as a string value.

Rückgabewert​

string


toUTCString()​

toUTCString(): string;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:918

Returns a date converted to a string using Universal Coordinated Time (UTC).

Rückgabewert​

string


valueOf()​

valueOf(): number;

Definiert in: cosmolink-typesaurus/node_modules/typescript/lib/lib.es5.d.ts:786

Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC.

Rückgabewert​

number