C# 클래스 Pchp.Library.DateTimeFunctions

파일 보기 프로젝트 열기: iolevel/peachpie

공개 메소드들

메소드 설명
checkdate ( int month, int day, int year ) : bool

Returns TRUE if the date given is valid; otherwise returns FALSE. Checks the validity of the date formed by the arguments.

A date is considered valid if: year is between 1 and 32767 inclusive month is between 1 and 12 inclusive day is within the allowed number of days for the given month. Leap years are taken into consideration.

date ( Context ctx, string format ) : string

Returns a string formatted according to the given format string using the current local time.

date ( Context ctx, string format, int timestamp ) : string

Returns a string formatted according to the given format string using the given integer timestamp.

date_sunrise ( Context ctx, int timestamp ) : PhpValue
date_sunrise ( Context ctx, int timestamp, TimeFormats format ) : PhpValue
date_sunrise ( Context ctx, int timestamp, TimeFormats format, double latitude ) : PhpValue
date_sunrise ( Context ctx, int timestamp, TimeFormats format, double latitude, double longitude ) : PhpValue
date_sunrise ( Context ctx, int timestamp, TimeFormats format, double latitude, double longitude, double zenith ) : PhpValue
date_sunrise ( Context ctx, int timestamp, TimeFormats format, double latitude, double longitude, double zenith, double offset ) : PhpValue
date_sunset ( Context ctx, int timestamp ) : PhpValue
date_sunset ( Context ctx, int timestamp, TimeFormats format ) : PhpValue
date_sunset ( Context ctx, int timestamp, TimeFormats format, double latitude ) : PhpValue
date_sunset ( Context ctx, int timestamp, TimeFormats format, double latitude, double longitude ) : PhpValue
date_sunset ( Context ctx, int timestamp, TimeFormats format, double latitude, double longitude, double zenith ) : PhpValue
date_sunset ( Context ctx, int timestamp, TimeFormats format, double latitude, double longitude, double zenith, double offset ) : PhpValue
getdate ( Context ctx ) : PhpArray

Returns an associative array containing the date information of the current local time.

getdate ( Context ctx, int timestamp ) : PhpArray

Returns an associative array containing the date information of the timestamp.

gettimeofday ( Context ctx ) : PhpArray

Gets time information.

It returns PhpArray containing the following 4 entries: "sec"Unix timestamp (seconds since the Unix Epoch) "usec"microseconds "minuteswest"minutes west of Greenwich (doesn't take daylight savings time in consideration) "dsttime"type of DST correction (+1 or 0, determined only by the current time zone not by the time)

gettimeofday ( Context ctx, bool returnDouble ) : object
gmdate ( string format ) : string

Identical to the date() function except that the time returned is Greenwich Mean Time (GMT)

gmdate ( string format, int timestamp ) : string

Identical to the date() function except that the time returned is Greenwich Mean Time (GMT)

idate ( Context ctx, string format ) : int

Returns a part of current time.

idate ( Context ctx, string format, int timestamp ) : int

Returns a part of a specified timestamp.

localtime ( Context ctx ) : PhpArray

The localtime() function returns an array identical to that of the structure returned by the C function call. Current time is used, regular numericaly indexed array is returned.

localtime ( Context ctx, int timestamp ) : PhpArray

The localtime() function returns an array identical to that of the structure returned by the C function call. Time specified by the parameter timestamp is used, regular numericaly indexed array is returned.

localtime ( Context ctx, int timestamp, bool returnAssociative ) : PhpArray

The localtime() function returns an array identical to that of the structure returned by the C function call. The first argument to localtime() is the timestamp. The second argument to the localtime() is the isAssociative, if this is set to false than the array is returned as a regular, numerically indexed array. If the argument is set to true then localtime() is an associative array containing all the different elements of the structure returned by the C function call to localtime.

Returned array contains these elements if isAssociative is set to true: "tm_sec"seconds "tm_min"minutes "tm_hour"hour "tm_mday"day of the month "tm_mon"month of the year, starting with 0 for January "tm_year"Years since 1900 "tm_wday"Day of the week "tm_yday"Day of the year "tm_isdst"Is daylight savings time in effect

microtime ( bool returnDouble ) : PhpValue

Returns the fractional time in seconds from the start of the UNIX epoch.

microtime ( ) : string

Returns the string "msec sec" where sec is the current time measured in the number of seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and msec is the microseconds part.

strtotime ( string time ) : int

Parses a string containing an English date format into a UNIX timestamp relative to the current time.

strtotime ( string time, int start ) : int

Parses a string containing an English date format into a UNIX timestamp relative to a specified time.

time ( ) : int

Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).

비공개 메소드들

메소드 설명
CalculateSunTime ( int day, double latitude, double longitude, double zenith, bool getSunrise ) : double

Calculates sunrise or sunset. Adopted PHP implementation by Moshe Doron ([email protected]). Returns UTC time.

FormatDate ( string format, System.DateTime utc, TimeZoneInfo zone ) : string
GetDate ( Context ctx, System.DateTime utc ) : PhpArray

Returns an associative array containing the date information.

GetDatePart ( char format, System.DateTime utc, TimeZoneInfo zone ) : int
GetDayNumberSuffix ( int DayNumber ) : string

English ordinal suffix for the day of the month, 2 characters - st, nd, rd or th.

GetIsoWeekAndYear ( System.DateTime dt, int &week, int &year ) : void

Converts a given DateTime to the ISO week of year number and ISO year number.

GetLocalTime ( TimeZoneInfo currentTz, System.DateTime utc, bool returnAssociative ) : PhpArray
GetNow ( Context ctx ) : System.DateTime

Gets the current local time with respect to the current PHP time zone.

GetSunTime ( Context ctx, int timestamp, TimeFormats format, double latitude, double longitude, double zenith, double offset, bool getSunrise ) : PhpValue
GetSwatchBeat ( System.DateTime utc ) : int
GetTimeOfDay ( System.DateTime utc, TimeZoneInfo zone ) : PhpArray
MakeDateTime ( int hour, int minute, int second, int month, int day, int year ) : System.DateTime
StringToTime ( string time, System.DateTime startUtc ) : int

Implementation of StringToTime(string,int) function.

ToDegrees ( double radians ) : double
ToRadians ( double degrees ) : double

메소드 상세

checkdate() 공개 정적인 메소드

Returns TRUE if the date given is valid; otherwise returns FALSE. Checks the validity of the date formed by the arguments.
A date is considered valid if: year is between 1 and 32767 inclusive month is between 1 and 12 inclusive day is within the allowed number of days for the given month. Leap years are taken into consideration.
public static checkdate ( int month, int day, int year ) : bool
month int Month
day int Day
year int Year
리턴 bool

date() 공개 정적인 메소드

Returns a string formatted according to the given format string using the current local time.
public static date ( Context ctx, string format ) : string
ctx Pchp.Core.Context Current runtime context.
format string Format definition for output.
리턴 string

date() 공개 정적인 메소드

Returns a string formatted according to the given format string using the given integer timestamp.
public static date ( Context ctx, string format, int timestamp ) : string
ctx Pchp.Core.Context Current runtime context.
format string Format definition for output.
timestamp int Nuber of seconds since 1970 specifying a date.
리턴 string

date_sunrise() 공개 정적인 메소드

public static date_sunrise ( Context ctx, int timestamp ) : PhpValue
ctx Pchp.Core.Context
timestamp int
리턴 Pchp.Core.PhpValue

date_sunrise() 공개 정적인 메소드

public static date_sunrise ( Context ctx, int timestamp, TimeFormats format ) : PhpValue
ctx Pchp.Core.Context
timestamp int
format TimeFormats
리턴 Pchp.Core.PhpValue

date_sunrise() 공개 정적인 메소드

public static date_sunrise ( Context ctx, int timestamp, TimeFormats format, double latitude ) : PhpValue
ctx Pchp.Core.Context
timestamp int
format TimeFormats
latitude double
리턴 Pchp.Core.PhpValue

date_sunrise() 공개 정적인 메소드

public static date_sunrise ( Context ctx, int timestamp, TimeFormats format, double latitude, double longitude ) : PhpValue
ctx Pchp.Core.Context
timestamp int
format TimeFormats
latitude double
longitude double
리턴 Pchp.Core.PhpValue

date_sunrise() 공개 정적인 메소드

public static date_sunrise ( Context ctx, int timestamp, TimeFormats format, double latitude, double longitude, double zenith ) : PhpValue
ctx Pchp.Core.Context
timestamp int
format TimeFormats
latitude double
longitude double
zenith double
리턴 Pchp.Core.PhpValue

date_sunrise() 공개 정적인 메소드

public static date_sunrise ( Context ctx, int timestamp, TimeFormats format, double latitude, double longitude, double zenith, double offset ) : PhpValue
ctx Pchp.Core.Context
timestamp int
format TimeFormats
latitude double
longitude double
zenith double
offset double
리턴 Pchp.Core.PhpValue

date_sunset() 공개 정적인 메소드

public static date_sunset ( Context ctx, int timestamp ) : PhpValue
ctx Pchp.Core.Context
timestamp int
리턴 Pchp.Core.PhpValue

date_sunset() 공개 정적인 메소드

public static date_sunset ( Context ctx, int timestamp, TimeFormats format ) : PhpValue
ctx Pchp.Core.Context
timestamp int
format TimeFormats
리턴 Pchp.Core.PhpValue

date_sunset() 공개 정적인 메소드

public static date_sunset ( Context ctx, int timestamp, TimeFormats format, double latitude ) : PhpValue
ctx Pchp.Core.Context
timestamp int
format TimeFormats
latitude double
리턴 Pchp.Core.PhpValue

date_sunset() 공개 정적인 메소드

public static date_sunset ( Context ctx, int timestamp, TimeFormats format, double latitude, double longitude ) : PhpValue
ctx Pchp.Core.Context
timestamp int
format TimeFormats
latitude double
longitude double
리턴 Pchp.Core.PhpValue

date_sunset() 공개 정적인 메소드

public static date_sunset ( Context ctx, int timestamp, TimeFormats format, double latitude, double longitude, double zenith ) : PhpValue
ctx Pchp.Core.Context
timestamp int
format TimeFormats
latitude double
longitude double
zenith double
리턴 Pchp.Core.PhpValue

date_sunset() 공개 정적인 메소드

public static date_sunset ( Context ctx, int timestamp, TimeFormats format, double latitude, double longitude, double zenith, double offset ) : PhpValue
ctx Pchp.Core.Context
timestamp int
format TimeFormats
latitude double
longitude double
zenith double
offset double
리턴 Pchp.Core.PhpValue

getdate() 공개 정적인 메소드

Returns an associative array containing the date information of the current local time.
public static getdate ( Context ctx ) : PhpArray
ctx Pchp.Core.Context
리턴 Pchp.Core.PhpArray

getdate() 공개 정적인 메소드

Returns an associative array containing the date information of the timestamp.
public static getdate ( Context ctx, int timestamp ) : PhpArray
ctx Pchp.Core.Context Current runtime context.
timestamp int Number of seconds since 1970.
리턴 Pchp.Core.PhpArray

gettimeofday() 공개 정적인 메소드

Gets time information.
It returns PhpArray containing the following 4 entries: "sec"Unix timestamp (seconds since the Unix Epoch) "usec"microseconds "minuteswest"minutes west of Greenwich (doesn't take daylight savings time in consideration) "dsttime"type of DST correction (+1 or 0, determined only by the current time zone not by the time)
public static gettimeofday ( Context ctx ) : PhpArray
ctx Pchp.Core.Context
리턴 Pchp.Core.PhpArray

gettimeofday() 공개 정적인 메소드

public static gettimeofday ( Context ctx, bool returnDouble ) : object
ctx Pchp.Core.Context
returnDouble bool
리턴 object

gmdate() 공개 정적인 메소드

Identical to the date() function except that the time returned is Greenwich Mean Time (GMT)
public static gmdate ( string format ) : string
format string Format definition for output.
리턴 string

gmdate() 공개 정적인 메소드

Identical to the date() function except that the time returned is Greenwich Mean Time (GMT)
public static gmdate ( string format, int timestamp ) : string
format string Format definition for output.
timestamp int Nuber of seconds since 1970 specifying a date.
리턴 string

idate() 공개 정적인 메소드

Returns a part of current time.
public static idate ( Context ctx, string format ) : int
ctx Pchp.Core.Context Current runtime context.
format string Format definition for output.
리턴 int

idate() 공개 정적인 메소드

Returns a part of a specified timestamp.
public static idate ( Context ctx, string format, int timestamp ) : int
ctx Pchp.Core.Context Current runtime context.
format string Format definition for output.
timestamp int Nuber of seconds since 1970 specifying a date.
리턴 int

localtime() 공개 정적인 메소드

The localtime() function returns an array identical to that of the structure returned by the C function call. Current time is used, regular numericaly indexed array is returned.
public static localtime ( Context ctx ) : PhpArray
ctx Pchp.Core.Context
리턴 Pchp.Core.PhpArray

localtime() 공개 정적인 메소드

The localtime() function returns an array identical to that of the structure returned by the C function call. Time specified by the parameter timestamp is used, regular numericaly indexed array is returned.
public static localtime ( Context ctx, int timestamp ) : PhpArray
ctx Pchp.Core.Context Current runtime context.
timestamp int Number of seconds since 1970.
리턴 Pchp.Core.PhpArray

localtime() 공개 정적인 메소드

The localtime() function returns an array identical to that of the structure returned by the C function call. The first argument to localtime() is the timestamp. The second argument to the localtime() is the isAssociative, if this is set to false than the array is returned as a regular, numerically indexed array. If the argument is set to true then localtime() is an associative array containing all the different elements of the structure returned by the C function call to localtime.
Returned array contains these elements if isAssociative is set to true: "tm_sec"seconds "tm_min"minutes "tm_hour"hour "tm_mday"day of the month "tm_mon"month of the year, starting with 0 for January "tm_year"Years since 1900 "tm_wday"Day of the week "tm_yday"Day of the year "tm_isdst"Is daylight savings time in effect
public static localtime ( Context ctx, int timestamp, bool returnAssociative ) : PhpArray
ctx Pchp.Core.Context Current runtime context.
timestamp int
returnAssociative bool
리턴 Pchp.Core.PhpArray

microtime() 공개 정적인 메소드

Returns the fractional time in seconds from the start of the UNIX epoch.
public static microtime ( bool returnDouble ) : PhpValue
returnDouble bool true to return the double, false to return string.
리턴 Pchp.Core.PhpValue

microtime() 공개 정적인 메소드

Returns the string "msec sec" where sec is the current time measured in the number of seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and msec is the microseconds part.
public static microtime ( ) : string
리턴 string

strtotime() 공개 정적인 메소드

Parses a string containing an English date format into a UNIX timestamp relative to the current time.
public static strtotime ( string time ) : int
time string String containing time definition
리턴 int

strtotime() 공개 정적인 메소드

Parses a string containing an English date format into a UNIX timestamp relative to a specified time.
public static strtotime ( string time, int start ) : int
time string String containing time definition.
start int Timestamp (seconds from 1970) to which is the new timestamp counted.
리턴 int

time() 공개 정적인 메소드

Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).
public static time ( ) : int
리턴 int