Welcome

Welcome, thanks to look my blog

Friday 18 December 2015

Date and Time Support Delphi

Date and Time Support

sumber:http://docwiki.embarcadero.com/RADStudio/Seattle/en/Date_and_Time_Support
This topic lists all types, routines, and variables that add Date and Time support.

Contents

 [hide

Date and Time Data Types

The following table lists the data types used to store date and time:
TypeDescription
System.TDate is used to represent a date.
TDateTime represents a date-and-time value in the Delphi language.
SysUtils.TTimeStamp represents time and date values.
System.TTime is used to represent a time.
Provides support for time zone.

Obtaining current Date and Time

The following table lists all routines used to obtain current date and time:
RoutineDescription
Returns the current year.
Returns the current date.
Returns the day of the week for a specified date.
Returns the current time.
Returns the current date and time.
Returns the current time.
Returns a TDateTime value that represents the current date.
Returns a System.TDateTime value that represents the following day.
Returns a System.TDateTime value that represents the preceding day.

Creating Date and Time values

The following table lists all routines used to create date and time values:
RoutineDescription
Returns a TDateTime value that represents a specified year, month, and day.
Returns a System.TDateTime that represents a specified day of the year for a specified year.
Returns a System.TDateTime that represents a specified day of a specified week in a specified month and year.
Returns a System.TDateTime that represents a specified year, month, day, hour, minute, second, and millisecond.
Returns a System.TDateTime that represents a specified day of a specified week in a specified year.
Returns a System.TDateTime that represents a specified occurrence of a day of the week within a specified month and year.
Returns a System.TDateTime value for a specified hour, minute, second, and millisecond.
Creates a System.TDateTime value that represents a specified year, month, and day.
Calculates the System.TDateTime value that represents a specified day of the year for a specified year.
Calculates the System.TDateTime value that represents a specified day of a specified week in a specified month and year.
Calculates the System.TDateTime value that represents a specified year, month, day, hour, minute, second, and millisecond.
Calculates the System.TDateTime value that represents a specified day of a specified week in a specified year.
Calculates a System.TDateTime that represents a specified occurrence of a day of the week within a specified month and year.
Creates a System.TDateTime value for a specified hour, minute, second, and millisecond.

Extracting information from date and time values

The following table lists all routines used to extract specific parts out of date and time values:
RoutineDescription
Strips the time portion from a TDateTime value.
Returns the day of the month represented by a System.TDateTime value.
Returns the day of the month represented by a System.TDateTime value.
Returns the day of the week represented by a System.TDateTime value.
Returns the number of days between a specified System.TDateTime value and December 31 of the previous year.
Returns Year, Month, and Day values for a System.TDateTime value.
Returns the year and day of the year for a specified System.TDateTime.
Returns Year, Month, Day, and Day-of-Week values for a System.TDateTime value.
Returns the year, month, week of the month, and day of the week for a specified System.TDateTime.
Returns Year, Month, Day, Hour, Minute, Second, and Millisecond values for a System.TDateTime.
Returns the year, week of the year, and day of the week for a specified System.TDateTime value object.
For a given System.TDateTime value, returns the year, month, day of the week, and the count of that day of the week in the month.
Breaks a System.TDateTime value into hours, minutes, seconds, and milliseconds.
Returns the hour of the day represented by a System.TDateTime value.
Returns the hour of the day represented by a System.TDateTime value.
Returns the number of hours between a specified System.TDateTime value and 12:00 A.M. of the first day of the month.
Returns the number of hours between a specified System.TDateTime value and 12:00 A.M. of the first day of the week.
Returns the number of hours between a specified System.TDateTime value and 12:00 A.M. of the first day of the year.
Returns the millisecond of the second represented by a System.TDateTime value.
Returns the number of milliseconds between a specified System.TDateTime value and the beginning of the same day.
Returns the number of milliseconds between a specified System.TDateTime value and the beginning of the same hour.
Returns the number of milliseconds between a specified System.TDateTime value and the beginning of the same minute.
Returns the number of milliseconds between a specified System.TDateTime value and the beginning of the month.
Returns the millisecond of the second represented by a System.TDateTime value.
Returns the number of milliseconds between a specified System.TDateTime value and 12:00:00:00 A.M. of the first day of the week.
Returns the number of milliseconds between a specified System.TDateTime value and 12:00:00:00 A.M. of the first day of the year.
Returns the minute of the hour represented by a System.TDateTime value.
Returns the number of minutes between a specified System.TDateTime value and 12:00 A.M. of the same day.
Returns the number of minutes between a specified System.TDateTime value and the beginning of the same hour.
Returns the number of minutes between a specified System.TDateTime value and 12:00 A.M. of the first day of the month.
Returns the number of minutes between a specified System.TDateTime value and 12:00 A.M. of the first day of the week.
Returns the number of minutes between a specified System.TDateTime value and 12:00 A.M. of the first day of the year.
Returns the month of the year represented by a System.TDateTime value.
Returns the month of the year represented by a System.TDateTime value.
Returns the weekday of the specified TDateTime value.
Returns the second of the minute represented by a System.TDateTime value.
Returns the number of seconds between a specified System.TDateTime value and 12:00:00 A.M. of the same day.
Returns the number of seconds between a specified System.TDateTime value and the beginning of the same hour.
Returns the number of seconds between a specified System.TDateTime value and the beginning of the same minute.
Returns the number of seconds between a specified System.TDateTime value and 12:00:00 A.M. on the first day of the month.
Returns the number of seconds between a specified System.TDateTime value and 12:00:00 A.M. of the first day of the week.
Returns the number of seconds between a specified System.TDateTime value and 12:00:00 A.M. on the first day of the year.
Strips the date portion from a System.TDateTime value.
Returns the week of the year represented by a System.TDateTime value.
Returns the week of the month represented by a System.TDateTime value.
Returns the week of the year represented by a System.TDateTime value.
Returns the number of weeks in a specified year.
Returns the number of weeks in the year of a specified System.TDateTime value.
Returns the year represented by a System.TDateTime value.

Comparing and Checking Date and Time values

The following table lists all routines used to compare and check date and time values:
RoutineDescription
Indicates the relationship between the date portions of two System.TDateTime values.
Indicates the relationship between two TDateTime values.
Indicates the relationship between the time portions of two System.TDateTime values.
Indicates whether a specified System.TDateTime value occurs in a leap year.
Indicates whether the time portion of a specified System.TDateTime value occurs before noon.
Indicates whether the time portion of a specified System.TDateTime value occurs after noon.
Indicates whether a specified System.TDateTime value occurs on the same day as a criterion date.
Indicates whether a specified System.TDateTime value occurs on the current date.
Indicates whether a specified year, month, and day represent a valid date.
Indicates whether a specified year and day of the year represent a valid date.
Indicates whether a specified year, month, week of the month, and day of the week represent a valid date.
Indicates whether a specified year, month, day, hour, minute, second, and millisecond represent a valid date and time.
Indicates whether a specified year, week of the year, and day of the week represent a valid date.
Indicates whether a specified hour, minute, second, and millisecond represent a valid date and time.
Indicates whether two System.TDateTime values represent the same year, month, and day.
Indicates whether two System.TDateTime values represent the same year, month, day, hour, minute, second, and millisecond.
Indicates whether two System.TDateTime values represent the same time of day, ignoring the date portion.
Indicates whether two dates are within a specified number of days of each other.
Indicates whether two date/time values are within a specified number of hours of each other.
Indicates whether two date/time values are within a specified number of milliseconds of each other.
Indicates whether two date/time values are within a specified number of minutes of each other.
Indicates whether two date/time values are within a specified number of months of each other.
Indicates whether two date/time values are within a specified number of seconds of each other.
Indicates whether two date/time values are within a specified number of weeks of each other.
Indicates whether two date/time values are within a specified number of years of each other.
Checks whether a System.TDate value is in a given range.
Checks whether a System.TDateTime value is in a given range.

Calculations on Date and Time values

The following table lists all routines used to perform calculations on Date and Time values:
RoutineDescription
Returns the number of days (including fractional days) between two specified TDateTime values.
Returns the number of whole days between two specified System.TDateTime values.
Returns the number of days in a specified month of a specified year.
Returns the number of days in a specified year.
Returns the number of days in the month of a specified System.TDateTime value.
Returns the number of days in the year of a specified System.TDateTime value.
Returns a System.TDateTime that represents the last millisecond of a specified day.
Returns a System.TDateTime that represents the last millisecond of the last day of a specified month.
Returns a System.TDateTime object value that represents the last millisecond of a specified day of a specified week.
Returns a System.TDateTime that represents the last millisecond of a specified year.
Returns a System.TDateTime that represents the last millisecond of the day identified by a specified System.TDateTime.
Returns a System.TDateTime that represents the last millisecond of the last day of the month identified by a specified System.TDateTime.
Returns a System.TDateTime that represents the last millisecond of the last day of the week identified by a specified System.TDateTime.
Returns a System.TDateTime that represents the last millisecond of the last day of the year identified by a specified System.TDateTime.
Returns the number of hours (including fractional hours) between two specified System.TDateTime values.
Returns the number of whole hours between two specified System.TDateTime values.
Increments date information by one month.
Returns a date shifted by a specified number of days.
Returns a date/time value shifted by a specified number of hours.
Returns a date/time value shifted by a specified number of milliseconds.
Returns a date/time value shifted by a specified number of minutes.
Returns a date shifted by a specified number of months.
Returns a date/time value shifted by a specified number of seconds.
Returns a date shifted by a specified number of weeks.
Returns a date shifted by a specified number of years.
Returns the number of milliseconds between two specified System.TDateTime values.
Returns the number of milliseconds between two specified System.TDateTime values.
Returns the number of minutes, including fractions thereof, between two specified System.TDateTime values.
Returns the number of minutes between two specified System.TDateTime values.
Returns the approximate number of months, including fractions, between two specified System.TDateTime values.
Returns the approximate number of months between two specified System.TDateTime values.
Replaces the date portion of a specified System.TDateTime value.
Selectively replaces parts of a specified System.TDateTime value.
Replaces the day of the month for a specified System.TDateTime value.
Replaces the hour of the day for a specified System.TDateTime value.
Replaces the millisecond of the second for a specified System.TDateTime value.
Replaces the minute of the hour for a specified System.TDateTime value.
Replaces the month of the year for a specified System.TDateTime value.
Replaces the second of the minute for a specified System.TDateTime value.
Replaces the time portion of a specified System.TDateTime value.
Replaces the year for a specified System.TDateTime value.
Returns the number of seconds (including fractions thereof) between two specified System.TDateTime values.
Returns the number of seconds between two specified System.TDateTime values.
Returns a System.TDateTime that represents 12:00:00:00 A.M. on a specified day.
Returns a System.TDateTime that represents 12:00:00:00 A.M. on the first day of a specified month.
Returns a System.TDateTime that represents the first moment on a specified day of a specified week.
Returns a System.TDateTime that represents the first moment on the first day of a specified year.
Returns a System.TDateTime that represents 12:00:00:00 A.M. on the day identified by a specified System.TDateTime.
Returns a System.TDateTime that represents 12:00:00:00 A.M. on the first day of the month identified by a specified System.TDateTime.
Returns a System.TDateTime that represents 12:00:00:00 A.M. on the first day of the week identified by a specified System.TDateTime.
Returns a System.TDateTime that represents 12:00:00:00 A.M. on the first day of the year identified by a specified System.TDateTime.
Returns the number of weeks (including fractional weeks) between two specified System.TDateTime values.
Returns the number of whole weeks between two specified System.TDateTime values.
Returns the approximate number of years (including fractions thereof) between two specified System.TDateTime values.
Returns the approximate number of years between two specified System.TDateTime values.

Converting Date and Time values

The following table lists all routines used to convert to or from date and time values:
RoutineDescription
Converts a date-and-time value, specified in the TDateTime format, into the ISO 8601 format.
Converts a TDateTime value to an OS timestamp value.
Converts a TDateTime value into a Julian date.
Converts a TDateTime value into a modified Julian date.
Converts a TDateTime value to a string, using the local settings for displaying date and time.
Converts a TDateTime value to a string, using a specified SysUtils.Format.
Converts a TDateTime value into the Win32 API's system time type.
Converts a TDateTime value into the corresponding TTimeStamp value.
Converts a TDateTime value into a Unix/Linux-style date-and-time value.
Converts a TDateTime value to a string.
Converts a date-and-time value, specified in the ISO 8601 format, into the TDateTime format.
Converts a Julian date to a TDateTime value.
Converts a specified number of milliseconds into a TTimeStamp value.
Converts a modified Julian date to a TDateTime value.
Converts a string to a TDateTime value.
Converts a string to a TDateTime value, with error default.
Converts a string to a TDateTime value.
Converts a string to a TDateTime value, with error default.
Converts a string to a TDateTime value.
Converts a string to a TDateTime value, with error default.
Converts a system time value into a TDateTime value.
Converts a TTimeStamp value into the corresponding TDateTime value.
Converts a TTimeStamp value into an absolute number of milliseconds.
Returns a string that represents a TDateTime value.
Converts a floating-point value to a TDateTime value.
Converts a Julian date to a TDateTime value.
Converts a modified Julian date to a TDateTime value.
Selectively replaces parts of a specified TDateTime value.
Converts a string to a TDateTime value, with a Boolean success code.
Converts a string to a TDateTime value, with a Boolean success code.
Converts a string to a TDateTime value, with an error default.
Converts a Unix/Linux style date-and-time value to a TDateTime value.

See Also

No comments:

Post a Comment