Date/Time Conversion Routines Category

Various routines for Converting between TDateTime andand Time Portions.

Routines
Date2AccessStrReturns Date as a string suitable for MS Access Date comparisons, ie #MM/DD/YYYY#.
Date2ANSISQLStrReturns Date as a string suitable for ANSI Standard comparisons, ie { d 'YYYY-MM-DD' }
Date2DayReturns the Day of the Month number from a given date/time.
Date2DigitStrReturns Date as a String in the format YYYYMMDD.
Date2FormatStrReturns Date as a String using Format.
Date2ISOEnhStrReturns Date as a Basic Format for ISO Dates: YYYY-MM-DD where YYYY is year, MM is the Month, DD is Day of Month.
Date2ISOIntReturns Date as a Basic Format for ISO Dates: YYYYMMDD where YYYY is year, MM is the Month, DD is Day of Month.
Date2ISOStrReturns Date as a Basic Format for ISO Dates: YYYYMMDD where YYYY is year, MM is the Month, DD is Day of Month.
Date2ISOWeekEnhStrReturns Date as a Enhanced Format for ISO Calendar Week/Day: YYYY-Www-D where YYYY is year, 'W' is literal, ww is weekno and D is the ISO Day of Week - Monday is First Day.
Date2ISOWeekOnlyEnhStrReturns Date as a Enhanced Format for ISO Calendar Week: YYYY-Www where YYYY is year, 'W' is literal, ww is weekno.
Date2ISOWeekOnlyStrReturns Date as a Basic Format for ISO Calendar Week: YYYYWww where YYYY is year, 'W' is literal, ww is weekno.
Date2ISOWeekStrReturns Date as a Basic Format for ISO Calendar Week/Day: YYYYWwwD where YYYY is year, 'W' is literal, ww is weekno and D is the ISO Day of Week - Monday is First Day.
Date2LongDOWReturns the Long Day of Week Description for the supplied Date.
Date2LongMonthReturns the Long Month Description for the supplied Date.
Date2MonthReturns the Month number from a given date/time, 1 = Jan, etc.
Date2ShortDOWReturns the Short Day of Week Description for the supplied Date.
Date2ShortMonthReturns the Short Month Description for the supplied Date.
Date2ShortMonthYYReturns the Short Month Description for the supplied Date followed by a space then the last two digits of the year.
Date2ShortMonthYYYYReturns the Short Month Description for the supplied Date followed by a space then the year.
Date2StarSignReturns the Star Sign (Astrology) for the Given Date.
Date2StrReturns Date as a String using ShortDateFormat from Regional Settings.
Date2YearReturns the Year from a given date/time.
Date2YearMonthReturns the (Year * 100 + Month) number for a given date/time, 3 Mar 2000 would give 200003
DateTime2FormatStrReturns Date/Time as a String using Format.
DayName2DOWGiven a Day Name this routines searches through the Short and then Long Day Names supplied in the Registry to do a Left Match, and then return the Day Number.
Days2FortnightsReturns the number of Fortnights the specified number of Days represents.
Days2HrsReturns the number of Hours the specified number of Days represents.
Days2MinsReturns the number of Minutes the specified number of Days represents.
Days2MonthsReturns the number of Months the specified number of Days represents.
Days2SecsReturns the number of Seconds the specified number of Days represents.
Days2SiderealDaysConverts "normal" 24-hour Days into Sidereal Days.
Days2WeeksReturns the number of Weeks the specified number of Days represents.
Days2YearsReturns the number of Years the specified number of Days represents.
Days2YearsGregorianReturns the number of Years the specified number of Days represents.
Days2YearsJulianReturns the number of Years the specified number of Days represents.
DigitStr2DateConverts a string containing a Date into a DateTime.
ESBDecodeDateAn Enhanced DecodeDate that includes Exception Handling.
ESBDecodeTimeAn Enhanced EncodeTime that includes Exception Handling.
ESBEncodeDateAn Enhanced EncodeDate that includes Exception Handling.
ESBEncodeTimeAn Enhanced EncodeTime that includes Exception Handling.
Fortnights2DaysReturns the number of Days the specified number of Fortnights represents.
GetESBDateOrderIdentifies which of the three common formats for Date Order that a given Date Format is in.
Hrs2DaysReturns the number of Days the specified number of Hours represents.
Hrs2MinsReturns the number of Minutes the specified number of Hours represents.
Hrs2SecsReturns the number of Seconds the specified number of Hours represents.
Mins2DaysReturns the number of Days the specified number of Minutes represents.
Mins2HrsReturns the number of Hours the specified number of Mintues represents.
Mins2SecsReturns the number of Minutes the specified number of Seconds represents.
MonthName2MonthGiven a Month Name this routines searches through the Short and then Long Month Names supplied in the Registry to do a Left Match, and then return the Month Number.
Months2DaysReturns the number of Days the specified number of Months represents.
OptDate2DayA Speed Optimised Routine for getting the Day portion of a Date based on Routine by Ken Otto that is many times faster than using DecodeDate in SysUtils.
OptDate2MonthA Speed Optimised Routine for getting the Month portion of a Date based on Routine by Ken Otto that is many times faster than using DecodeDate in SysUtils.
OptDate2YearA Speed Optimised Routine for getting the Year portion of a Date based on Routine by Ken Otto that is many times faster than using DecodeDate in SysUtils.
OptDecodeDateIA Speed Optimised DecodeDate developed by Ken Otto that is many times faster than the once included in SysUtils.
OptDecodeDateWA Speed Optimised DecodeDate developed by Ken Otto that is many times faster than the once included in SysUtils.
OptEncodeDateIA Speed Optimised EncodeDate developed by Ken Otto that is many times faster than the once included in SysUtils, and includes Exception Handling.
OptEncodeDateWA Speed Optimised EncodeDate developed by Ken Otto that is many times faster than the once included in SysUtils, and includes Exception Handling.
OptThisDayReturns the current Day - from Today's Date.
OptThisMonthReturns the current Month - from Today's Date.
OptThisYearReturns the current Year - from Today's Date.
Secs2DaysReturns the number of Days the specified number of Seconds represents.
Secs2HrsReturns the number of Hours the specified number of Seconds represents.
Secs2MinsReturns the number of Seconds the specified number of Mintues represents.
SiderealDays2DaysConverts Sidereal Days into "normal" 24-hour Days.
Str2CutOffDateConverts a string containing a Date into a DateTime.
Str2DateConverts a string containing a Date into a DateTime.
Str2HistoricDateConverts a string containing a Date into a DateTime.
Str2TimeConverts a string containing a Time into a DateTime.
StrFormat2DateConverts a string containing a Date into a DateTime.
ThisDayReturns the current Day - from Today's Date.
ThisDOWReturns the current Day of the week from Today's Date.
ThisHrReturns the current Hour - from the current Time.
ThisISODOWReturns the current Day of the week from Today's Date, according to ISO-8601 which has Monday as 1 and Sunday as 7.
ThisMinReturns the current Minute - from the current Time.
ThisMonthReturns the current Month - from Today's Date.
ThisMSecReturns the current Millisecond - from the current Time.
ThisSecReturns the current Second - from the current Time.
ThisYearReturns the current Year - from Today's Date.
Time2FormatStrReturns Time as a String using Format.
Time2HrReturns the Hour from a given date/time.
Time2MinReturns the Minute from a given date/time.
Time2MSecReturns the Millisecond from a given date/time.
Time2SecReturns the Second from a given date/time.
Time2StrReturns the Time Portion as a string HH:MM with time separator from the Regional Settings.
Weeks2DaysReturns the number of Days the specified number of Weeks represents.
Years2DaysReturns the number of Days the specified number of Years represents.
YearsGregorian2DaysReturns the number of Days the specified number of Years represents.
YearsJulian2DaysReturns the number of Days the specified number of Years represents.


HTML generated by Time2HELP
http://www.time2help.com