Arsip: fungsi tanggal

more 18 years ago
yayaretina
buat para expert, minta tlg nih... mungkin dah sering di bahas tapi aku search pake kata tanggal/date ga ketemu... kalo pun ketemu gak spt yang aku butuhin.. anyway..
gini, aku mau bikin aplikasi yang fungsinya untuk nambah atau ngurangin tanggal.. contohnya hari ini 30 Oktober, trus aku tambah 2 (string) itu hasilnya 2 Nov. nah fungsi tanggal yang seperti ini scriptnya gimana...
before and after Thanks....

more 18 years ago
budi_bunga
coba pake datetimepicker kemudian datetimepickernya + 1 trus, decodedate deh satu persatu tahun buan dan tglnya, mungkin ini bisa membantu :)

more 18 years ago
yayaretina
ada yang bisa bantu ama scriptnya ga... soale aku belum begitu paham dengan fungsi date... hehehehehe...

more 18 years ago
boy_borland
di delphi 7 saya pake fungsi incday,
uses DateUtils;
var
d:TDatetime;
...
d:=incday(date,3); // hasilnye d=3/11/2006
...

more 18 years ago
ansr
ada yang bisa bantu ama scriptnya ga...ada...... sayangnya aku bukan expert.. he..he..he.. coba yang ini...
function Tform1.tglperbulan(bulan, tahun : integer):integer;
const
jmlhariperbln : array of integer = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
begin
if (bulan = 2) then
if (tahun mod 4 = 0) then
result := 29
else
result := jmlhariperbln[2]
else
result := jmlhariperbln[bulan];
end;
procedure TForm1.tambahtglClick(Sender: TObject);
begin
inc(tgl);
if tgl > tglperbulan(bln, thn)then
begin
inc(bln);
tgl := 1;
end;
datetimepicker1.Date := encodedate(thn, bln, tgl);
end;
procedure TForm1.FormCreate(Sender: TObject);
var
kalender : tdatetime;
begin
kalender := datetimepicker1.Date;
decodedate(kalender, thn, bln, tgl);
end;
procedure TForm1.kurangtglClick(Sender: TObject);
begin
dec(tgl);
if tgl < 1 then
begin
dec(bln);
tgl := tglperbulan(bln,thn);
end;
datetimepicker1.Date := encodedate(thn, bln, tgl);
end;
end.
mungkin ada yang lebih sederhana dari yang aku buat...... :D
more 18 years ago
ZeAL
Teken F1 donk... hehehe.. untuk fungsi pertanggalan di delphi dah cukup lengkap kok..
CheckSqlTimeStamp procedure
Checks whether a TSQLTimeStamp value represents a valid date and time.
CompareDate function
Indicates the relationship between the date portions of two TDateTime values.
CompareDateTime function
Indicates the relationship between two TDateTime values.
CompareTime function
Indicates the relationship between the time portions of two TDateTime values.
CurrentYear function
Returns the current year.
Date function
Returns the current date.
DateDelta constant
Specifies the difference between TDateTime and TTimeStamp values.
DateOf function
Strips the time portion from a TDateTime value.
DateTimeToFileDate function
Converts a TDateTime object to an OS timestamp.
DateTimeToSQLTimeStamp function
Converts a TDateTime value to a TSQLTimeStamp value.
DateTimeToStr function
Converts a TDateTime value to a string.
DateTimeToString procedure
Converts a TDateTime value to a string using a specified Format.
DateTimeToSystemTime procedure
Converts a TDateTime value into the Win32 API's system time type.
DateTimeToTimeStamp function
Converts a TDateTime value into the corresponding TTimeStamp value.
DateToStr function
Converts a TDateTime value to a string.
Day of week constants
Provide symbolic constants for ISO 8601-compliant day of the week values.
DayOf function
Returns the day of the month represented by a TDateTime value.
DayOfTheMonth function
Returns the day of the month represented by a TDateTime value.
DayOfTheWeek function
Returns the day of the week represented by a TDateTime value.
DayOfTheYear function
Returns the number of days between a specified TDateTime value and December 31 of the previous year.
DayOfWeek function
Returns the day of the week for a specified date.
DaysBetween function
Returns the number of whole days between two specified TDateTime values.
DaysInAMonth function
Returns the number of days in a specified month of a specified year.
DaysInAYear function
Returns the number of days in a specified year.
DaysInMonth function
Returns the number of days in the month of a specified TDateTime value.
DaysInYear function
Returns the number of days in the year of a specified TDateTime value.
DaySpan function
Returns the number of days (including fractional days) between two specified TDateTime values.
DecodeDate procedure
Returns Year, Month, and Day values for a TDateTime value.
DecodeDateDay procedure
Returns the year and day of the year for a specified TDateTime.
DecodeDateFully function
Returns Year, Month, and Day, and Day-of-Week values for a TDateTime value.
DecodeDateMonthWeek procedure
Returns the year, month, week of the month, and day of the week for a specified TDateTime.
DecodeDateTime procedure
Returns Year, Month, Day, Hour, Minute, Second, and Millisecond values for a TDateTime.
DecodeDateWeek procedure
Returns the year, week of the year, and day of the week for a specified TDateTime value.
DecodeDayOfWeekInMonth procedure
For a given TDateTime value, returns the year, month, day of the week, and the count of that day of the week in the month.
DecodeTime procedure
Breaks a TDateTime value into hours, minutes, seconds, and milliseconds.
EncodeDate function function
Returns a TDateTime value that represents a specified Year, Month, and Day.
EncodeDateDay function
Returns a TDateTime that represents a specified day of the year for a specified year.
EncodeDateMonthWeek function
Returns a TDateTime that represents a specified day of a specified week in a specified month and year.
EncodeDateTime function
Returns a TDateTime that represents a specified year, month, day, hour, minute, second, and millisecond.
EncodeDateWeek function
Returns a TDateTime that represents a specified day of a specified week in a specified year.
EncodeDayOfWeekInMonth function
Returns a TDateTime that represents a specified occurrence of a day of the week within a specified month and year.
EncodeTime function
Returns a TDateTime value for a specified Hour, Min, Sec, and MSec.
EndOfADay function
Returns a TDateTime that represents the last millisecond of a specified day.
EndOfAMonth function
Returns a TDateTime that represents the last millisecond of the last day of a specified month.
EndOfAWeek function
Returns a TDateTime value that represents the last millisecond of a specified day of a specified week.
EndOfAYear function
Returns a TDateTime that represents the last millisecond of a specified year.
EndOfTheDay function
Returns a TDateTime that represents the last millisecond of the day identified by a specified TDateTime.
EndOfTheMonth function
Returns a TDateTime that represents the last millisecond of the last day of the month identified by a specified TDateTime.
EndOfTheWeek function
Returns a TDateTime that represents the last millisecond of the last day of the week identified by a specified TDateTime.
EndOfTheYear function
Returns a TDateTime that represents the last millisecond of the last day of the year identified by a specified TDateTime.
FormatDateTime function
Formats a TDateTime value.
HourOf function
Returns the hour of the day represented by a TDateTime value.
HourOfTheDay function
Returns the hour of the day represented by a TDateTime value.
HourOfTheMonth function
Returns the number of hours between a specified TDateTime value and 12:00 AM of the first day of the month.
HourOfTheWeek function
Returns the number of hours between a specified TDateTime value and 12:00 AM of the first day of the week.
HourOfTheYear function
Returns the number of hours between a specified TDateTime value and 12:00 AM of the first day of the year.
HoursBetween function
Returns the number of whole hours between two specified TDateTime values.
HourSpan function
Returns the number of Hours (including fractional Hours) between two specified TDateTime values.
IncAMonth procedure
Increments date data by one month.
IncDay function
Returns a date shifted by a specified number of days.
IncHour function
Returns a date/time value shifted by a specified number of hours.
IncMilliSecond function
Returns a date/time value shifted by a specified number of milliseconds.
IncMinute function
Returns a date/time value shifted by a specified number of minutes.
IncMonth function
Returns a date shifted by a specified number of months.
IncSecond function
Returns a date/time value shifted by a specified number of seconds.
IncWeek function
Returns a date shifted by a specified number of weeks.
IncYear function
Returns a date shifted by a specified number of years.
IsInLeapYear function
Indicates whether a specified TDateTime value occurs in a leap year.
IsLeapYear function
Indicates whether a specified year is a leap year.
IsPM function
Indicates whether the time portion of a specified TDateTime value occurs after noon.
IsSameDay function
Indicates whether a specified TDateTime value occurs on a the same day as a criterion date.
IsToday function
Indicates whether a specified TDateTime value occurs on the current date.
IsValidDate function
Indicates whether a specified year, month, and day represent a valid date.
IsValidDateDay function
Indicates whether a specified year and day of the year represent a valid date.
IsValidDateMonthWeek function
Indicates whether a specified year, month, week of the month, and day of the week represent a valid date.
IsValidDateTime function
Indicates whether a specified year, month, day, hour, minute, second, and millisecond represent a valid date and time.
IsValidDateWeek function
Indicates whether a specified year, week of the year, and day of the week represent a valid date.
IsValidTime function
Indicates whether a specified hour, minute, second, and millisecond represent a valid date and time.
MilliSecondOf function
Returns the millisecond of the second represented by a TDateTime value.
MilliSecondOfTheDay function
Returns the number of milliseconds between a specified TDateTime value and the beginning of the same day.
MilliSecondOfTheHour function
Returns the number of milliseconds between a specified TDateTime value and the beginning of the same hour.
MilliSecondOfTheMinute function
Returns the number of milliseconds between a specified TDateTime value and the beginning of the same minute.
MilliSecondOfTheMonth function
Returns the number of milliseconds between a specified TDateTime value and the beginning of the month.
MilliSecondOfTheSecond function
Returns the millisecond of the second represented by a TDateTime value.
MilliSecondOfTheWeek function
Returns the number of milliseconds between a specified TDateTime value and 12:00:00:00 AM of the first day of the week.
MilliSecondOfTheYear function
Returns the number of milliseconds between a specified TDateTime value and 12:00:00:00 AM of the first day of the year.
MilliSecondsBetween function
Returns the number of milliseconds between two specified TDateTime values.
MilliSecondSpan function
Returns the number of milliseconds between two specified TDateTime values.
MinuteOf function
Returns the minute of the hour represented by a TDateTime value.
MinuteOfTheDay function
Returns the number of minutes between a specified TDateTime value and 12:00 AM of the same day.
MinuteOfTheHour function
Returns the number of minutes between a specified TDateTime value and the beginning of the same hour.
MinuteOfTheMonth function
Returns the number of minutes between a specified TDateTime value and 12:00 AM of the first day of the month.
MinuteOfTheWeek function
Returns the number of minutes between a specified TDateTime value and 12:00 AM of the first day of the week.
MinuteOfTheYear function
Returns the number of minutes between a specified TDateTime value and 12:00 AM of the first day of the year.
MinutesBetween function
Returns the number of minutes between two specified TDateTime values.
MinuteSpan function
Returns the number of minutes, including fractions thereof, between two specified TDateTime values.
MonthOf function
Returns the month of the year represented by a TDateTime value.
MonthOfTheYear function
Returns the month of the year represented by a TDateTime value.
MonthsBetween function
Returns the approximate number of months between two specified TDateTime values.
MonthSpan function
Returns the approximate number of months, including fractions, between two specified TDateTime values.
MSecsToTimeStamp function
Converts a specified number of milliseconds into a TTimeStamp value.
Now function
Returns the current date and time.
NthDayOfWeek function
Returns which occurrence of its weekday a specified TDateTime value represents.
NullSQLTimeStamp constant
Represents a NULL TSQLTimeStamp value.
OneHour Constant;OneMillisecond Constant;OneMinute Constant;OneSecond Constant
Delphi inverse time unit constants.
RecodeDate function
Replaces the date portion of a specified TDateTime value.
RecodeDateTime function
Selectively replaces parts of a specified TDateTime value.
RecodeDay function
Replaces the day of the month for a specified TDateTime value.
RecodeHour function
Replaces the hour of the day for a specified TDateTime value.
RecodeMilliSecond function
Replaces the millisecond of the second for a specified TDateTime value.
RecodeMinute function
Replaces the minute of the hour for a specified TDateTime value.
RecodeMonth function
Replaces the month of the year for a specified TDateTime value.
RecodeSecond function
Replaces the second of the minute for a specified TDateTime value.
RecodeTime function
Replaces the time portion of a specified TDateTime value.
RecodeYear function
Replaces the year for a specified TDateTime value.
ReplaceDate procedure
Replaces the date portion of a TDateTime value with a specified date.
ReplaceTime procedure
Replaces the time portion of a TDateTime value with a specified time.
SameDate function
Indicates whether two TDateTime values represent the same year, month, and day.
SameDateTime function
Indicates whether two TDateTime values represent the same year, month, day, hour, minute, second, and millisecond.
SameTime function
Indicates whether two TDateTime values represent the same time of day, ignoring the date portion.
SecondOf function
Returns the second of the minute represented by a TDateTime value.
SecondOfTheDay function
Returns the number of seconds between a specified TDateTime value and 12:00:00 AM of the same day.
SecondOfTheHour function
Returns the number of seconds between a specified TDateTime value and the beginning of the same hour.
SecondOfTheMinute function
Returns the number of seconds between a specified TDateTime value and the beginning of the same minute.
SecondOfTheMonth function
Returns the number of seconds between a specified TDateTime value and 12:00:00 AM on the first day of the month.
SecondOfTheWeek function
Returns the number of seconds between a specified TDateTime value and 12:00:00 AM of the first day of the week.
SecondOfTheYear function
Returns the number of seconds between a specified TDateTime value and 12:00:00 AM on the first day of the year.
SecondsBetween function
Returns the number of seconds between two specified TDateTime values.
SecondSpan function
Returns the number of seconds (including fractions thereof) between two specified TDateTime values.
SQLDayOfWeek function
Indicates the day of the week when a specified TSQLTimeStamp value occurs.
SQLTimeStampToDateTime function
Converts a TSQLTimeStamp value to a TDateTime value.
SQLTimeStampToStr function
Converts a TSQLTimeStamp value to a string.
StartOfADay function
Returns a TDateTime that represents 12:00:00:00 AM on a specified day.
StartOfAMonth function
Returns a TDateTime that represents 12:00:00:00 AM on the first day of a specified month.
StartOfAWeek function
Returns a TDateTime that represents 1the first moment on a specified day of a specified week.
StartOfAYear function
Returns a TDateTime that represents the first moment on the first day of a specified year.
StartOfTheDay function
Returns a TDateTime that represents 12:00:00:00 AM on the day identified by a specified TDateTime.
StartOfTheMonth function
Returns a TDateTime that represents 12:00:00:00 AM on the first day of the month identified by a specified TDateTime.
StartOfTheWeek function
Returns a TDateTime that represents 12:00:00:00 AM on the first day of the week identified by a specified TDateTime.
StartOfTheYear function
Returns a TDateTime that represents 12:00:00:00 AM on the first day of the year identified by a specified TDateTime.
StrToDate function
Converts a string to a TDateTime value.
StrToDateDef function
Converts a string to a TDateTime value, with error default.
StrToDateTime function
Converts a string to a TDateTime value.
StrToDateTimeDef function
Converts a string to a TDateTime value with error default.
StrToSQLTimeStamp function
Converts a string to a TSQLTimeStamp value.
StrToTime function
Converts a string to a TDateTime value.
StrToTimeDef function
Converts a string to a TDateTime value with error default.
SystemTimeToDateTime function
Converts a system time value into a TDateTime value.
Time unit constants
Represent useful values for time calculations.
Time, GetTime functions
Returns the current time.
TimeOf function
Strips the date portion from a TDateTime value.
TimeStampToDateTime function
Converts a TTimeStamp value into the corresponding TDateTime value.
TimeStampToMSecs function
Converts a TTimeStamp value into an absolute number of milliseconds.
TimeToStr function
Returns a string that represents a TDateTime value.
Today function
Returns a TDateTime value that represents the current date.
Tomorrow function
Returns a TDateTime value that represents the following day.
TryEncodeDate function
Creates a TDateTime value that represents a specified Year, Month, and Day.
TryEncodeDateDay function
Calculates the TDateTime value that represents a specified day of the year for a specified year.
TryEncodeDateMonthWeek function
Calculates the TDateTime value that represents a specified day of a specified week in a specified month and year.
TryEncodeDateTime function
Calculates the TDateTime value that represents a specified year, month, day, hour, minute, second, and millisecond.
TryEncodeDateWeek function
Calculates the TDateTime value that represents a specified day of a specified week in a specified year.
TryEncodeDayOfWeekInMonth function
Calculates a TDateTime that represents a specified occurrence of a day of the week within a specified month and year.
TryEncodeTime function
Creates a TDateTime value for a specified Hour, Min, Sec, and MSec.
TryRecodeDateTime function
Selectively replaces parts of a specified TDateTime value.
TryStrToDate function
Converts a string to a TDateTime value, with a Boolean success code.
TryStrToDateTime function
Converts a string to a TDateTime value with a Boolean success code.
TryStrToSQLTimeStamp function
Converts a string to a TSQLTimeStamp value.
TryStrToTime function
Converts a string to a TDateTime value with an error default.
UnixDateDelta constant
Specifies the difference between TDateTime and TIME_T values.
WeekOf function
Returns the week of the year represented by a TDateTime value.
WeekOfTheMonth function
Returns the week of the month represented by a TDateTime value.
WeekOfTheYear function
Returns the week of the year represented by a TDateTime value.
WeeksBetween function
Returns the number of whole weeks between two specified TDateTime values.
WeeksInAYear function
Returns the number of weeks in a specified year.
WeeksInYear function
Returns the number of weeks in the year of a specified TDateTime value.
WeekSpan function
Returns the number of weeks (including fractional weeks) between two specified TDateTime values.
WithinPastDays function
Indicates whether two dates are within a specified number of days of each other.
WithinPastHours function
Indicates whether two date/time values are within a specified number of hours of each other.
WithinPastMilliSeconds function
Indicates whether two date/time values are within a specified number of milliseconds of each other.
WithinPastMinutes function
Indicates whether two date/time values are within a specified number of minutes of each other.
WithinPastMonths function
Indicates whether two date/time values are within a specified number of months of each other.
WithinPastSeconds function
Indicates whether two date/time values are within a specified number of seconds of each other.
WithinPastWeeks function
Indicates whether two date/time values are within a specified number of weeks of each other.
WithinPastYears function
Indicates whether two date/time values are within a specified number of years of each other.
YearOf function
Returns the year represented by a TDateTime value.
YearsBetween function
Returns the approximate number of years between two specified TDateTime values.
YearSpan function
Returns the approximate number of years (including fractions thereof) between two specified TDateTime values.
Yesterday function
Returns a TDateTime value that represents the preceding day.
Dan tadi gue tese kalo sebuah variabel TDateTime langsung ditambah dengan variabel integer, maka harinya akan otomatis ditambah dengan variabel tersebut..
var i : TDateTime;
begin
i := now;
i := i + 2;
showmessage(DateToStr(i));

more 18 years ago
yayaretina
thanks ya semuanya... ntar ta cobain..
------------------------------------------
kapan sih ni warnet instal delphi...
more ...
- Pages:
- 1
reply |
Report Obsolete
AI Forward

🚀 We're thrilled to partner with Alibaba Cloud for "AI Forward - Alibaba Cloud Global Developer Summit 2025" in Jakarta! Join us and explore the future of AI. Register now:
https://int.alibabacloud.com/m/1000400772/
#AlibabaCloud #DeveloperSummit #Jakarta #AIFORWARD
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 5 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- DBExpress VS ADO
by OnDelphi80 in Hal umum tentang Pascal Indonesia more 18 years ago - Jam Analog..??
by asiyrob in Tip n Trik Pemrograman more 17 years ago - Seach pake ADOQuery
by RoenZ in Lain-lain more 16 years ago - mengubah warna pada TbitButton
by divanda in Tip n Trik Pemrograman more 17 years ago - insert mssql
by brodien in MsSQL more 18 years ago - Ms Access Network
by R-One in Lain-lain more 17 years ago - inisial folder
by strike_set in Enginering more 18 years ago - Fingerprint
by guebego in Network, Files, I/O & System more 16 years ago - Akses Component TEdit, TMemo, dll dr aplikasi lain......
by mas_kofa in Multimedia & Graphic Enhancement more 17 years ago - Ask: About mySQL tools ?
by cyber_hecker in MySQL more 19 years ago