C# Класс System.Date

Represents the ECMA Date object.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Date ( )

Initializes a new instance of the Date class.

Date ( int year, int month, int date, int hours, int minutes, int seconds, int milliseconds )

Initializes a new instance of the Date class.

Date ( long milliseconds )

Initializes a new instance of the Date class.

Date ( string dateString )

Initializes a new instance of the Date class.

UTC ( ) : int

Gets the number of milliseconds in a date string sine Jan 1, 1970, in universal time.

getDate ( ) : int

Get the day of the month.

getDay ( ) : int

Gets the day of the week.

getFullYear ( ) : int

Gets the full year.

getHours ( ) : int

Gets the hour.

getMilliseconds ( ) : int

Gets the milliseconds.

getMinutes ( ) : int

Gets the minutes.

getMonth ( ) : int

Gets the month.

getSeconds ( ) : int

Gets the seconds.

getTime ( ) : int

Get the number of milliseconds since Jan 1, 1970.

getTimezoneOffset ( ) : int

Gets the time difference between GMT and local time, in minutes.

getUTCDate ( ) : int

Gets the day of the month, in universal time.

getUTCDay ( ) : int

Gets the day of the week, in universal time.

getUTCFullYear ( ) : int

Gets the year, in universal time.

getUTCHours ( ) : int

Gets the hour, in universal time.

getUTCMilliseconds ( ) : int

Gets the milliseconds, in universal time.

getUTCMinutes ( ) : int

Gets the minutes, in universal time.

getUTCMonth ( ) : int

Gets the month, in universal time.

getUTCSeconds ( ) : int

Gets the seconds, in universal time.

now ( ) : int

Gets the current date and time as an offset in milliseconds since Jan 1, 1970.

parse ( string dateString ) : int

A string representing a date.

setDate ( int date ) : void

Sets the day of the month, from 1-31.

setFullYear ( int year ) : void

Sets the four digit year.

setHours ( int hour ) : void

Sets the hour, from 0-23.

setMilliseconds ( int milliseconds ) : void

Sets the milliseconds, from 0-999.

setMinutes ( int minute ) : void

Set the minutes, from 0-59.

setMonth ( int month ) : void

Sets the month, from 0-11.

setSeconds ( int second ) : void

Sets the seconds, from 0-59.

setTime ( int millisecond ) : void

Sets the time as an offset in milliseconds from Jan 1, 1970.

setUTCDate ( int month ) : void

Sets the day of the month, in universal time, from 1-31.

setUTCFullYear ( int year ) : void

Set the four digit year, in universal time.

setUTCHours ( int hour ) : void

Sets the hour, in universal time, from 0-23.

setUTCMilliseconds ( int millisecond ) : void

Sets the milliseconds, in universal time, from 0-999.

setUTCMinutes ( int minute ) : void

Set the minutes, in universal time, from 0-59.

setUTCMonth ( int month ) : void

Sets the month, in universal time, from 0-11.

setUTCSeconds ( int second ) : void

Set the seconds, in universal time, from 0-59.

toDateString ( ) : string

Gets the date portion of a date object as a string.

toLocaleDateString ( ) : string

Gets the date portion of a date object as a string, using locale conventions.

toLocaleTimeString ( ) : string

Gets the time portion of a date object as a string, using locale conventions.

toTimeString ( ) : string

Gets the time portion of a date object as a string.

toUTCString ( ) : string

Gets a date string, in universal time.

Описание методов

Date() публичный метод

Initializes a new instance of the Date class.
public Date ( )

Date() публичный метод

Initializes a new instance of the Date class.
public Date ( int year, int month, int date, int hours, int minutes, int seconds, int milliseconds )
year int The year.
month int The month.
date int The date.
hours int The hours.
minutes int The minutes.
seconds int The seconds.
milliseconds int The milliseconds.

Date() публичный метод

Initializes a new instance of the Date class.
public Date ( long milliseconds )
milliseconds long The milliseconds.

Date() публичный метод

Initializes a new instance of the Date class.
public Date ( string dateString )
dateString string The date string.

UTC() публичный статический метод

Gets the number of milliseconds in a date string sine Jan 1, 1970, in universal time.
public static UTC ( ) : int
Результат int

getDate() публичный метод

Get the day of the month.
public getDate ( ) : int
Результат int

getDay() публичный метод

Gets the day of the week.
public getDay ( ) : int
Результат int

getFullYear() публичный метод

Gets the full year.
public getFullYear ( ) : int
Результат int

getHours() публичный метод

Gets the hour.
public getHours ( ) : int
Результат int

getMilliseconds() публичный метод

Gets the milliseconds.
public getMilliseconds ( ) : int
Результат int

getMinutes() публичный метод

Gets the minutes.
public getMinutes ( ) : int
Результат int

getMonth() публичный метод

Gets the month.
public getMonth ( ) : int
Результат int

getSeconds() публичный метод

Gets the seconds.
public getSeconds ( ) : int
Результат int

getTime() публичный метод

Get the number of milliseconds since Jan 1, 1970.
public getTime ( ) : int
Результат int

getTimezoneOffset() публичный метод

Gets the time difference between GMT and local time, in minutes.
public getTimezoneOffset ( ) : int
Результат int

getUTCDate() публичный метод

Gets the day of the month, in universal time.
public getUTCDate ( ) : int
Результат int

getUTCDay() публичный метод

Gets the day of the week, in universal time.
public getUTCDay ( ) : int
Результат int

getUTCFullYear() публичный метод

Gets the year, in universal time.
public getUTCFullYear ( ) : int
Результат int

getUTCHours() публичный метод

Gets the hour, in universal time.
public getUTCHours ( ) : int
Результат int

getUTCMilliseconds() публичный метод

Gets the milliseconds, in universal time.
public getUTCMilliseconds ( ) : int
Результат int

getUTCMinutes() публичный метод

Gets the minutes, in universal time.
public getUTCMinutes ( ) : int
Результат int

getUTCMonth() публичный метод

Gets the month, in universal time.
public getUTCMonth ( ) : int
Результат int

getUTCSeconds() публичный метод

Gets the seconds, in universal time.
public getUTCSeconds ( ) : int
Результат int

now() публичный статический метод

Gets the current date and time as an offset in milliseconds since Jan 1, 1970.
public static now ( ) : int
Результат int

parse() публичный статический метод

A string representing a date.
public static parse ( string dateString ) : int
dateString string
Результат int

setDate() публичный метод

Sets the day of the month, from 1-31.
public setDate ( int date ) : void
date int The date value.
Результат void

setFullYear() публичный метод

Sets the four digit year.
public setFullYear ( int year ) : void
year int The year value.
Результат void

setHours() публичный метод

Sets the hour, from 0-23.
public setHours ( int hour ) : void
hour int The hour value.
Результат void

setMilliseconds() публичный метод

Sets the milliseconds, from 0-999.
public setMilliseconds ( int milliseconds ) : void
milliseconds int The millisecond value.
Результат void

setMinutes() публичный метод

Set the minutes, from 0-59.
public setMinutes ( int minute ) : void
minute int The minute value.
Результат void

setMonth() публичный метод

Sets the month, from 0-11.
public setMonth ( int month ) : void
month int The month value.
Результат void

setSeconds() публичный метод

Sets the seconds, from 0-59.
public setSeconds ( int second ) : void
second int The second value.
Результат void

setTime() публичный метод

Sets the time as an offset in milliseconds from Jan 1, 1970.
public setTime ( int millisecond ) : void
millisecond int The millisecond value.
Результат void

setUTCDate() публичный метод

Sets the day of the month, in universal time, from 1-31.
public setUTCDate ( int month ) : void
month int The month value.
Результат void

setUTCFullYear() публичный метод

Set the four digit year, in universal time.
public setUTCFullYear ( int year ) : void
year int The year value.
Результат void

setUTCHours() публичный метод

Sets the hour, in universal time, from 0-23.
public setUTCHours ( int hour ) : void
hour int The hour value.
Результат void

setUTCMilliseconds() публичный метод

Sets the milliseconds, in universal time, from 0-999.
public setUTCMilliseconds ( int millisecond ) : void
millisecond int The millisecond value.
Результат void

setUTCMinutes() публичный метод

Set the minutes, in universal time, from 0-59.
public setUTCMinutes ( int minute ) : void
minute int The minute value.
Результат void

setUTCMonth() публичный метод

Sets the month, in universal time, from 0-11.
public setUTCMonth ( int month ) : void
month int The month value.
Результат void

setUTCSeconds() публичный метод

Set the seconds, in universal time, from 0-59.
public setUTCSeconds ( int second ) : void
second int The second value.
Результат void

toDateString() публичный метод

Gets the date portion of a date object as a string.
public toDateString ( ) : string
Результат string

toLocaleDateString() публичный метод

Gets the date portion of a date object as a string, using locale conventions.
public toLocaleDateString ( ) : string
Результат string

toLocaleTimeString() публичный метод

Gets the time portion of a date object as a string, using locale conventions.
public toLocaleTimeString ( ) : string
Результат string

toTimeString() публичный метод

Gets the time portion of a date object as a string.
public toTimeString ( ) : string
Результат string

toUTCString() публичный метод

Gets a date string, in universal time.
public toUTCString ( ) : string
Результат string