Last active
April 4, 2023 15:32
-
-
Save bayramcetin/9a93d2b9041d8c60f15614cdab53429e to your computer and use it in GitHub Desktop.
Date Job
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal final class ETGDateRunnableJob | |
{ | |
/// <summary> | |
/// Class entry point. The system will call this method when a designated menu | |
/// is selected or when execution starts and this class is set as the startup class. | |
/// </summary> | |
/// <param name = "_args">The specified arguments.</param> | |
public static void main(Args _args) | |
{ | |
//Bugün | |
today(); | |
timeNow(); | |
systemDateGet(); | |
DateTimeUtil::getToday(DateTimeUtil::getUserPreferredTimeZone()); | |
DateTimeUtil::getSystemDateTime(); | |
DateTimeUtil::utcNow(); | |
//minimum ve maksimum tarihler | |
DateTimeUtil::minValue(); | |
DateTimeUtil::maxValue(); | |
maxDate(); | |
//null | |
dateNull(); | |
utcDateTimeNull(); | |
//Zaman dilimi | |
DateTimeUtil::getUserPreferredTimeZone(); | |
DateTimeUtil::getCompanyTimeZone(); | |
//zaman dilimi uygulamak | |
DateTimeUtil::applyTimeZoneOffset(DateTimeUtil::getSystemDateTime(), DateTimeUtil::getUserPreferredTimeZone()); | |
//Hafta enum | |
//WeekDays::Thursday | |
//Ay enum | |
//MonthsOfYear::April | |
//tarih oluşturur | |
TransDate date1 = mkDate(22,11,2023); | |
Info(strFmt("date1: %1", date1)); | |
//tarihin yılını döner | |
Year year = year(date1); | |
Info(strFmt("Year: %1", year)); | |
//tarihin ayını döner | |
Months month = mthOfYr(date1); | |
Info(strFmt("Months: %1", month)); | |
//tarihin haftasını döner | |
Week week = wkOfYr(date1); | |
Info(strFmt("Week: %1", week)); | |
//ayın son günü | |
TransDate endDate = endMth(date1); | |
Info(strFmt("endDate: %1", endDate)); | |
//ayın ilk günü | |
TransDate startDate = dateStartMth(date1); | |
Info(strFmt("startDate: %1", startDate)); | |
//haftanın ilk günü | |
TransDate weekStartDate = dateStartWk(date1); | |
Info(strFmt("weekStartDate: %1", weekStartDate)); | |
//haftanın son günü | |
TransDate weekEndDate = dateEndWk(date1); | |
Info(strFmt("weekEndDate: %1", weekEndDate)); | |
//yılın kaçıncı günü | |
Day dayOfYear = dayOfYr(date1); | |
Info(strFmt("dayOfYear: %1", dayOfYear)); | |
//ayın kaçınçı günü | |
Day dayOfMonth = dayOfMth(date1); | |
Info(strFmt("dayOfMonth: %1", dayOfMonth)); | |
//haftanın kaçıncı günü | |
Day dayOfWeek = dayOfWk(date1); | |
Info(strFmt("dayOfWeek: %1", dayOfWeek)); | |
//ayın ismini döner | |
MonthName monthName = mthName(mthOfYr(date1)); | |
Info(strFmt("monthName: %1", monthName)); | |
//tarih sıralama | |
TransDate date2 = str2Date("22/11/2023", 123); | |
Info(strFmt("date2: %1", date2)); | |
//tarih sıralama 2 | |
str DDMMYYYY = date2str(date2, 123, DateDay::Digits2, DateSeparator::None, DateMonth::Digits2, DateSeparator::None, DateYear::Digits4); | |
Info(strFmt("DDMMYYYY: %1", DDMMYYYY)); | |
//Saat oluşturmak | |
int time = str2time("01:15:00"); | |
Info(strFmt("time: %1", time)); | |
//DateTime oluşturmak | |
TransDateTime dateTime1 = DateTimeUtil::newDateTime(date1, time); | |
Info(strFmt("dateTime1: %1", dateTime1)); | |
//DateTime'dan tarihini almak | |
TransDate dateTimeDate = DateTimeUtil::date(dateTime1); | |
Info(strFmt("dateTimeDate: %1", dateTimeDate)); | |
//DateTime gün farkı | |
int64 second = DateTimeUtil::getDifference(DateTimeUtil::maxValue(), dateTime1); | |
real day = second / (60 * 60 * 24); | |
Info(strFmt("dayDifferent: %1", day)); | |
//tarihe bir ay ekler | |
TransDate nextMthDate = nextMth(date1); | |
Info(strFmt("nextMthDate: %1", nextMthDate)); | |
//tarihe bir çeyrek ekler | |
TransDate nextQtrDate = nextQtr(date1); | |
Info(strFmt("nextQtrDate: %1", nextQtrDate)); | |
//tarihe bir yıl ekler | |
TransDate nextYearDate = nextYr(date1); | |
Info(strFmt("nextYearDate: %1", nextYearDate)); | |
//tarihten bir ay çıkartır | |
TransDate prevMthDate = prevMth(date1); | |
Info(strFmt("prevMthDate: %1", prevMthDate)); | |
//tarihten bir çeyrek çıkartır | |
TransDate prevQtrDate = prevQtr(date1); | |
Info(strFmt("prevQtrDate: %1", prevQtrDate)); | |
//tarihten bir yıl çıkartır. | |
TransDate prevYearDate = prevYr(date1); | |
Info(strFmt("prevYearDate: %1", prevYearDate)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment